From 68bb7c9621bc02451f968a3d389a2f6ff2daddfb Mon Sep 17 00:00:00 2001 From: trialuser02 Date: Fri, 22 Jan 2010 22:07:03 +0000 Subject: added special class for settings git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@1523 90c681e8-e032-0410-971d-27865f9a5e38 --- src/plugins/General/lyrics/lyricswindow.cpp | 14 ++++++++------ .../General/lyrics/translations/lyrics_plugin_cs.ts | 18 +++++++++--------- .../General/lyrics/translations/lyrics_plugin_de.ts | 18 +++++++++--------- .../General/lyrics/translations/lyrics_plugin_it.ts | 18 +++++++++--------- .../General/lyrics/translations/lyrics_plugin_lt.ts | 18 +++++++++--------- .../General/lyrics/translations/lyrics_plugin_pl.ts | 18 +++++++++--------- .../General/lyrics/translations/lyrics_plugin_ru.ts | 18 +++++++++--------- .../General/lyrics/translations/lyrics_plugin_tr.ts | 18 +++++++++--------- .../General/lyrics/translations/lyrics_plugin_uk_UA.ts | 18 +++++++++--------- .../General/lyrics/translations/lyrics_plugin_zh_CN.ts | 18 +++++++++--------- .../General/lyrics/translations/lyrics_plugin_zh_TW.ts | 18 +++++++++--------- src/plugins/General/scrobbler/scrobbler.cpp | 12 +++++++----- src/plugins/Transports/http/downloader.cpp | 17 ++++++++--------- 13 files changed, 113 insertions(+), 110 deletions(-) (limited to 'src/plugins') diff --git a/src/plugins/General/lyrics/lyricswindow.cpp b/src/plugins/General/lyrics/lyricswindow.cpp index a3c9262bd..22b81b1b9 100644 --- a/src/plugins/General/lyrics/lyricswindow.cpp +++ b/src/plugins/General/lyrics/lyricswindow.cpp @@ -21,6 +21,7 @@ #include #include #include +#include #include #include "lyricswindow.h" @@ -35,12 +36,13 @@ LyricsWindow::LyricsWindow(const QString &artist, const QString &title, QWidget ui.artistLineEdit->setText(artist); ui.titleLineEdit->setText(title); m_http = new QHttp(this); - //load global proxy settings - if (Qmmp::useProxy()) - m_http->setProxy(Qmmp::proxy().host(), - Qmmp::proxy().port(), - Qmmp::useProxyAuth() ? Qmmp::proxy().userName() : QString(), - Qmmp::useProxyAuth() ? Qmmp::proxy().password() : QString()); + //load global proxy settings + QmmpSettings *gs = QmmpSettings::instance(); + if (gs->isProxyEnabled()) + m_http->setProxy(gs->proxy().host(), + gs->proxy().port(), + gs->useProxyAuth() ? gs->proxy().userName() : QString(), + gs->useProxyAuth() ? gs->proxy().password() : QString()); connect(m_http, SIGNAL(done(bool)), SLOT(showText(bool))); connect(m_http, SIGNAL(stateChanged(int)), SLOT(showState (int))); on_searchPushButton_clicked(); diff --git a/src/plugins/General/lyrics/translations/lyrics_plugin_cs.ts b/src/plugins/General/lyrics/translations/lyrics_plugin_cs.ts index 9b34d1a6f..fcdbd173b 100644 --- a/src/plugins/General/lyrics/translations/lyrics_plugin_cs.ts +++ b/src/plugins/General/lyrics/translations/lyrics_plugin_cs.ts @@ -45,48 +45,48 @@ LyricsWindow - + Lyrics: %1 - %2 Text: %1 - %2 - + No connection Nespojeno - + Not found Nenalezeno - + Looking up host... Vyhledávám hostitele... - + Connecting... Připojuji se... - + Sending request... Zasílám požadavek... - + Receiving Příjímám - + Connected Připojeno - + Closing connection... Zavírám spojení... diff --git a/src/plugins/General/lyrics/translations/lyrics_plugin_de.ts b/src/plugins/General/lyrics/translations/lyrics_plugin_de.ts index 1d92d840e..4468195c3 100644 --- a/src/plugins/General/lyrics/translations/lyrics_plugin_de.ts +++ b/src/plugins/General/lyrics/translations/lyrics_plugin_de.ts @@ -45,48 +45,48 @@ LyricsWindow - + Lyrics: %1 - %2 Liedtext: %1 - %2 - + No connection Keine Verbindung - + Not found Es kann kein Liedtext für dieses Stück gefunden werden. - + Looking up host... - + Connecting... Verbindung wird hergestellt ... - + Sending request... Anfrage wird gesendet ... - + Receiving Daten werden empfangen - + Connected Verbunden - + Closing connection... Verbindung wird beendet ... diff --git a/src/plugins/General/lyrics/translations/lyrics_plugin_it.ts b/src/plugins/General/lyrics/translations/lyrics_plugin_it.ts index 6b33254dc..96d95caf7 100644 --- a/src/plugins/General/lyrics/translations/lyrics_plugin_it.ts +++ b/src/plugins/General/lyrics/translations/lyrics_plugin_it.ts @@ -45,48 +45,48 @@ LyricsWindow - + Lyrics: %1 - %2 Testo: %1 - %2 - + No connection Nessuna connessione - + Not found Non trovato - + Looking up host... Ricerca host - + Connecting... Connessione... - + Sending request... Invio richiesta... - + Receiving Ricezione - + Connected Connesso - + Closing connection... Chiusura connessione... diff --git a/src/plugins/General/lyrics/translations/lyrics_plugin_lt.ts b/src/plugins/General/lyrics/translations/lyrics_plugin_lt.ts index 3d4679e70..2852b4c50 100644 --- a/src/plugins/General/lyrics/translations/lyrics_plugin_lt.ts +++ b/src/plugins/General/lyrics/translations/lyrics_plugin_lt.ts @@ -45,48 +45,48 @@ LyricsWindow - + Lyrics: %1 - %2 Dainos tekstas: %1 - %2 - + No connection Nėra ryšio - + Not found Nerasta - + Looking up host... Ieškau serverio... - + Connecting... Susijungiu... - + Sending request... Siunčiu užklausą... - + Receiving Gaunu - + Connected Susijungiau - + Closing connection... Atsijungiu... diff --git a/src/plugins/General/lyrics/translations/lyrics_plugin_pl.ts b/src/plugins/General/lyrics/translations/lyrics_plugin_pl.ts index 172c2ad77..ed895ea69 100644 --- a/src/plugins/General/lyrics/translations/lyrics_plugin_pl.ts +++ b/src/plugins/General/lyrics/translations/lyrics_plugin_pl.ts @@ -45,48 +45,48 @@ LyricsWindow - + Not found Nie znaleziono - + No connection Nie połączony - + Looking up host... Szukanie hosta... - + Connecting... Łączenie... - + Sending request... Wysyłanie żądania... - + Receiving Odbieranie - + Connected Połączony - + Closing connection... Zamykanie połączenia... - + Lyrics: %1 - %2 Teksty: %1 - %2 diff --git a/src/plugins/General/lyrics/translations/lyrics_plugin_ru.ts b/src/plugins/General/lyrics/translations/lyrics_plugin_ru.ts index 22ed6ba07..1b74bc398 100644 --- a/src/plugins/General/lyrics/translations/lyrics_plugin_ru.ts +++ b/src/plugins/General/lyrics/translations/lyrics_plugin_ru.ts @@ -45,48 +45,48 @@ LyricsWindow - + Lyrics: %1 - %2 Текст песни: %1 - %2 - + No connection Нет соединения - + Not found - + Looking up host... Поиск сервера... - + Connecting... Соединение... - + Sending request... Отправка запроса... - + Receiving Получение - + Connected Соединено - + Closing connection... Завершение соединения... diff --git a/src/plugins/General/lyrics/translations/lyrics_plugin_tr.ts b/src/plugins/General/lyrics/translations/lyrics_plugin_tr.ts index c650efd79..43666207f 100644 --- a/src/plugins/General/lyrics/translations/lyrics_plugin_tr.ts +++ b/src/plugins/General/lyrics/translations/lyrics_plugin_tr.ts @@ -45,48 +45,48 @@ LyricsWindow - + Not found - + No connection Bağlantı yok - + Looking up host... Sunucu aranıyor... - + Connecting... Bağlanıyor... - + Sending request... İstek gönderiliyor... - + Receiving Alınıyor - + Connected Bağlandı - + Closing connection... Bağlantı kapatılıyor... - + Lyrics: %1 - %2 Şarkı Sözü: %1 - %2 diff --git a/src/plugins/General/lyrics/translations/lyrics_plugin_uk_UA.ts b/src/plugins/General/lyrics/translations/lyrics_plugin_uk_UA.ts index 95fee4347..c779dee83 100644 --- a/src/plugins/General/lyrics/translations/lyrics_plugin_uk_UA.ts +++ b/src/plugins/General/lyrics/translations/lyrics_plugin_uk_UA.ts @@ -45,48 +45,48 @@ LyricsWindow - + Lyrics: %1 - %2 Тексти: %1 - %2 - + No connection Немає з'єднання - + Not found Не знайдено - + Looking up host... Пошук хоста... - + Connecting... З'єднання... - + Sending request... Відсилання запиту... - + Receiving Отримання - + Connected З'єднано - + Closing connection... Закриття з'єднання... diff --git a/src/plugins/General/lyrics/translations/lyrics_plugin_zh_CN.ts b/src/plugins/General/lyrics/translations/lyrics_plugin_zh_CN.ts index e3c947fbc..f80d1053d 100644 --- a/src/plugins/General/lyrics/translations/lyrics_plugin_zh_CN.ts +++ b/src/plugins/General/lyrics/translations/lyrics_plugin_zh_CN.ts @@ -45,48 +45,48 @@ LyricsWindow - + Lyrics: %1 - %2 歌词:%1 - %2 - + No connection 无连接 - + Not found - + Looking up host... 查找主机... - + Connecting... 连接... - + Sending request... 发送请求... - + Receiving 接受 - + Connected 已连接 - + Closing connection... 关闭连接... diff --git a/src/plugins/General/lyrics/translations/lyrics_plugin_zh_TW.ts b/src/plugins/General/lyrics/translations/lyrics_plugin_zh_TW.ts index 0772fc458..b89a1f1c9 100644 --- a/src/plugins/General/lyrics/translations/lyrics_plugin_zh_TW.ts +++ b/src/plugins/General/lyrics/translations/lyrics_plugin_zh_TW.ts @@ -45,48 +45,48 @@ LyricsWindow - + Lyrics: %1 - %2 歌詞:%1 - %2 - + No connection 無連接 - + Not found - + Looking up host... 找尋主機... - + Connecting... 連接... - + Sending request... 發送請求... - + Receiving 接受 - + Connected 已連接 - + Closing connection... 關閉連接... diff --git a/src/plugins/General/scrobbler/scrobbler.cpp b/src/plugins/General/scrobbler/scrobbler.cpp index c263ba8b9..5d6b38f76 100644 --- a/src/plugins/General/scrobbler/scrobbler.cpp +++ b/src/plugins/General/scrobbler/scrobbler.cpp @@ -27,6 +27,7 @@ #include #include #include +#include #include #include "scrobbler.h" @@ -51,11 +52,12 @@ Scrobbler::Scrobbler(const QString &url, m_server = url; m_name = name; //load global proxy settings - if (Qmmp::useProxy()) - m_http->setProxy(Qmmp::proxy().host(), - Qmmp::proxy().port(), - Qmmp::useProxyAuth() ? Qmmp::proxy().userName() : QString(), - Qmmp::useProxyAuth() ? Qmmp::proxy().password() : QString()); + QmmpSettings *gs = QmmpSettings::instance(); //TODO use QmmpSettings::networkSettingsChanged() + if (gs->isProxyEnabled()) + m_http->setProxy(gs->proxy().host(), + gs->proxy().port(), + gs->useProxyAuth() ? gs->proxy().userName() : QString(), + gs->useProxyAuth() ? gs->proxy().password() : QString()); m_disabled = m_login.isEmpty() || m_passw.isEmpty(); m_passw = QString(QCryptographicHash::hash(m_passw.toAscii(), QCryptographicHash::Md5).toHex()); diff --git a/src/plugins/Transports/http/downloader.cpp b/src/plugins/Transports/http/downloader.cpp index 76f7c31ac..37e9c3061 100644 --- a/src/plugins/Transports/http/downloader.cpp +++ b/src/plugins/Transports/http/downloader.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2006-2009 by Ilya Kotov * + * Copyright (C) 2006-2010 by Ilya Kotov * * forkotov02@hotmail.ru * * * * This program is free software; you can redistribute it and/or modify * @@ -20,11 +20,11 @@ #include #include -#include #include #include #include #include +#include #include #include #include "downloader.h" @@ -215,17 +215,16 @@ void Downloader::run() qDebug("Downloader: starting download thread"); m_handle = curl_easy_init(); //proxy - QSettings settings ( Qmmp::configFile(), QSettings::IniFormat ); - if (Qmmp::useProxy()) + if (QmmpSettings::instance()->isProxyEnabled()) curl_easy_setopt(m_handle, CURLOPT_PROXY, - strdup((Qmmp::proxy().host() + ":" + - QString("%1").arg(Qmmp::proxy().port())). + strdup((QmmpSettings::instance()->proxy().host() + ":" + + QString("%1").arg(QmmpSettings::instance()->proxy().port())). toLatin1 ().constData ())); - if (Qmmp::useProxyAuth()) + if (QmmpSettings::instance()->useProxyAuth()) curl_easy_setopt(m_handle, CURLOPT_PROXYUSERPWD, - strdup((Qmmp::proxy().userName() + ":" + - Qmmp::proxy().password()). + strdup((QmmpSettings::instance()->proxy().userName() + ":" + + QmmpSettings::instance()->proxy().password()). toLatin1 ().constData ())); // Set url to download -- cgit v1.2.3-13-gbd6f