diff --git a/.gitignore b/.gitignore index 3768f765..e0079899 100644 --- a/.gitignore +++ b/.gitignore @@ -18,4 +18,4 @@ ui_ massif.out.* ms_print.* doc/ - +.qmake.stash diff --git a/arora.pro b/arora.pro index f4db8e27..b4ff19a4 100644 --- a/arora.pro +++ b/arora.pro @@ -1,5 +1,5 @@ -lessThan(QT_VERSION, 4.5) { - error("Arora requires Qt 4.5 or greater") +lessThan(QT_VERSION, 5.0) { + error("Arora requires Qt 5.0 or greater") } TEMPLATE = subdirs @@ -13,3 +13,4 @@ unix { doxygen.depends = Doxyfile QMAKE_EXTRA_TARGETS += doxygen } + diff --git a/autotests/adblock/adblockmanager/tst_adblockmanager.cpp b/autotests/adblock/adblockmanager/tst_adblockmanager.cpp index f27d9179..12926d86 100644 --- a/autotests/adblock/adblockmanager/tst_adblockmanager.cpp +++ b/autotests/adblock/adblockmanager/tst_adblockmanager.cpp @@ -26,8 +26,6 @@ * SUCH DAMAGE. */ -#include -#include #include #include "adblockdialog.h" @@ -35,6 +33,10 @@ #include "adblocksubscription.h" #include +#include +#include +#include + class tst_AdBlockManager : public QObject { diff --git a/autotests/cookiejar/tst_cookiejar.cpp b/autotests/cookiejar/tst_cookiejar.cpp index b7f5219e..ba912ba1 100644 --- a/autotests/cookiejar/tst_cookiejar.cpp +++ b/autotests/cookiejar/tst_cookiejar.cpp @@ -126,7 +126,7 @@ void tst_CookieJar::cookiejar() jar.call_cookiesChanged(); QCOMPARE(jar.call_isOnDomainList(QStringList(), QString()), false); #endif - QSKIP("Test is not implemented.", SkipAll); + QSKIP("Test is not implemented."); } Q_DECLARE_METATYPE(CookieJar::AcceptPolicy) @@ -152,7 +152,7 @@ void tst_CookieJar::acceptPolicy() QCOMPARE(spy0.count(), 0); #endif - QSKIP("Test is not implemented.", SkipAll); + QSKIP("Test is not implemented."); } void tst_CookieJar::allowedCookies_data() @@ -177,7 +177,7 @@ void tst_CookieJar::allowedCookies() QCOMPARE(spy0.count(), 0); #endif - QSKIP("Test is not implemented.", SkipAll); + QSKIP("Test is not implemented."); } void tst_CookieJar::allowForSessionCookies_data() @@ -202,7 +202,7 @@ void tst_CookieJar::allowForSessionCookies() QCOMPARE(spy0.count(), 0); #endif - QSKIP("Test is not implemented.", SkipAll); + QSKIP("Test is not implemented."); } void tst_CookieJar::blockedCookies_data() @@ -227,7 +227,7 @@ void tst_CookieJar::blockedCookies() QCOMPARE(spy0.count(), 0); #endif - QSKIP("Test is not implemented.", SkipAll); + QSKIP("Test is not implemented."); } void tst_CookieJar::clear_data() @@ -251,7 +251,7 @@ void tst_CookieJar::clear() QCOMPARE(spy0.count(), 0); #endif - QSKIP("Test is not implemented.", SkipAll); + QSKIP("Test is not implemented."); } void tst_CookieJar::cookiesForUrl_data() @@ -278,7 +278,7 @@ void tst_CookieJar::cookiesForUrl() QCOMPARE(spy0.count(), 0); #endif - QSKIP("Test is not implemented.", SkipAll); + QSKIP("Test is not implemented."); } Q_DECLARE_METATYPE(CookieJar::KeepPolicy) @@ -304,7 +304,7 @@ void tst_CookieJar::keepPolicy() QCOMPARE(spy0.count(), 0); #endif - QSKIP("Test is not implemented.", SkipAll); + QSKIP("Test is not implemented."); } void tst_CookieJar::loadSettings_data() @@ -328,7 +328,7 @@ void tst_CookieJar::loadSettings() QCOMPARE(spy0.count(), 0); #endif - QSKIP("Test is not implemented.", SkipAll); + QSKIP("Test is not implemented."); } void tst_CookieJar::setAcceptPolicy_data() @@ -353,7 +353,7 @@ void tst_CookieJar::setAcceptPolicy() QCOMPARE(spy0.count(), 0); #endif - QSKIP("Test is not implemented.", SkipAll); + QSKIP("Test is not implemented."); } void tst_CookieJar::setAllowedCookies_data() @@ -378,7 +378,7 @@ void tst_CookieJar::setAllowedCookies() QCOMPARE(spy0.count(), 0); #endif - QSKIP("Test is not implemented.", SkipAll); + QSKIP("Test is not implemented."); } void tst_CookieJar::setAllowForSessionCookies_data() @@ -403,7 +403,7 @@ void tst_CookieJar::setAllowForSessionCookies() QCOMPARE(spy0.count(), 0); #endif - QSKIP("Test is not implemented.", SkipAll); + QSKIP("Test is not implemented."); } void tst_CookieJar::setBlockedCookies_data() @@ -428,7 +428,7 @@ void tst_CookieJar::setBlockedCookies() QCOMPARE(spy0.count(), 0); #endif - QSKIP("Test is not implemented.", SkipAll); + QSKIP("Test is not implemented."); } void tst_CookieJar::setCookiesFromUrl_data() @@ -457,7 +457,7 @@ void tst_CookieJar::setCookiesFromUrl() QCOMPARE(spy0.count(), 0); #endif - QSKIP("Test is not implemented.", SkipAll); + QSKIP("Test is not implemented."); } void tst_CookieJar::setKeepPolicy_data() @@ -482,7 +482,7 @@ void tst_CookieJar::setKeepPolicy() QCOMPARE(spy0.count(), 0); #endif - QSKIP("Test is not implemented.", SkipAll); + QSKIP("Test is not implemented."); } void tst_CookieJar::cookiesChanged_data() @@ -506,7 +506,7 @@ void tst_CookieJar::cookiesChanged() QCOMPARE(spy0.count(), 0); #endif - QSKIP("Test is not implemented.", SkipAll); + QSKIP("Test is not implemented."); } void tst_CookieJar::isOnDomainList_data() diff --git a/autotests/downloadmanager/tst_downloadmanager.cpp b/autotests/downloadmanager/tst_downloadmanager.cpp index 40e54407..0d4eb956 100644 --- a/autotests/downloadmanager/tst_downloadmanager.cpp +++ b/autotests/downloadmanager/tst_downloadmanager.cpp @@ -76,7 +76,7 @@ void tst_DownloadManager::init() QSettings settings; settings.clear(); - QFile file(QDesktopServices::storageLocation(QDesktopServices::DesktopLocation) + '/' + BIGFILENAME); + QFile file(QStandardPaths::writableLocation(QStandardPaths::DesktopLocation) + '/' + BIGFILENAME); file.remove(); } @@ -149,7 +149,7 @@ void tst_DownloadManager::cleanupButton() } } - QFile file(QDesktopServices::storageLocation(QDesktopServices::DesktopLocation) + '/' + BIGFILENAME); + QFile file(QStandardPaths::writableLocation(QStandardPaths::DesktopLocation) + '/' + BIGFILENAME); QCOMPARE(file.exists(), true); file.remove(); } @@ -200,7 +200,7 @@ void tst_DownloadManager::download() } for (int i = 0; i < requestfilename.count(); ++i) { - QFile file(QDesktopServices::storageLocation(QDesktopServices::DesktopLocation) + '/' + requestfilename[i]); + QFile file(QStandardPaths::writableLocation(QStandardPaths::DesktopLocation) + '/' + requestfilename[i]); // bad file stil returns a 404 webpage QVERIFY(file.exists()); file.remove(); @@ -237,7 +237,7 @@ void tst_DownloadManager::removePolicy() QCOMPARE(view->model()->rowCount(), (removePolicy == DownloadManager::SuccessFullDownload) ? 0 : 1); } - QFile file(QDesktopServices::storageLocation(QDesktopServices::DesktopLocation) + '/' + BIGFILENAME); + QFile file(QStandardPaths::writableLocation(QStandardPaths::DesktopLocation) + '/' + BIGFILENAME); file.remove(); SubDownloadManager manager; diff --git a/autotests/opensearchengine/tst_opensearchengine.cpp b/autotests/opensearchengine/tst_opensearchengine.cpp index 0b383787..fcb91fc2 100644 --- a/autotests/opensearchengine/tst_opensearchengine.cpp +++ b/autotests/opensearchengine/tst_opensearchengine.cpp @@ -18,7 +18,7 @@ * Boston, MA 02110-1301 USA */ -#include +#include #include "qtry.h" #include "opensearchengine.h" #include "opensearchenginedelegate.h" @@ -29,7 +29,6 @@ #include #include #include -#include #include typedef OpenSearchEngine::Parameters Parameters; @@ -866,8 +865,10 @@ void tst_OpenSearchEngine::delegate() QCOMPARE(delegate.lastData, QByteArray()); QNetworkRequest request(QUrl(engine.call_parseTemplate(QString("baz"), engine.searchUrlTemplate()))); QCOMPARE(delegate.lastRequest, request); - QVERIFY(delegate.lastRequest.url().hasQueryItem("q")); - QCOMPARE(delegate.lastRequest.url().queryItemValue("q"), QString("baz")); + + QUrlQuery urlQuery(delegate.lastRequest.url().query()); + QVERIFY(urlQuery.hasQueryItem("q")); + QCOMPARE(urlQuery.queryItemValue("q"), QString("baz")); engine.setSearchParameters(Parameters() << Parameter("a", "b") << Parameter("b", "c")); engine.requestSearchResults(QString("baz")); @@ -876,12 +877,13 @@ void tst_OpenSearchEngine::delegate() QCOMPARE(delegate.lastOperation, QNetworkAccessManager::GetOperation); QCOMPARE(delegate.lastData, QByteArray()); - QVERIFY(delegate.lastRequest.url().hasQueryItem("a")); - QCOMPARE(delegate.lastRequest.url().queryItemValue("a"), QString("b")); - QVERIFY(delegate.lastRequest.url().hasQueryItem("b")); - QCOMPARE(delegate.lastRequest.url().queryItemValue("b"), QString("c")); - QVERIFY(delegate.lastRequest.url().hasQueryItem("q")); - QCOMPARE(delegate.lastRequest.url().queryItemValue("q"), QString("baz")); + QUrlQuery q2(delegate.lastRequest.url().query()); + QVERIFY(q2.hasQueryItem("a")); + QCOMPARE(q2.queryItemValue("a"), QString("b")); + QVERIFY(q2.hasQueryItem("b")); + QCOMPARE(q2.queryItemValue("b"), QString("c")); + QVERIFY(q2.hasQueryItem("q")); + QCOMPARE(q2.queryItemValue("q"), QString("baz")); QUrl url(engine.call_parseTemplate(QString("baz"), engine.searchUrlTemplate())); QCOMPARE(delegate.lastRequest.url().toString(QUrl::RemoveQuery), url.toString(QUrl::RemoveQuery)); @@ -893,8 +895,10 @@ void tst_OpenSearchEngine::delegate() QCOMPARE(delegate.lastOperation, QNetworkAccessManager::PostOperation); request = QNetworkRequest(QUrl(engine.call_parseTemplate(QString("baz"), engine.searchUrlTemplate()))); QCOMPARE(delegate.lastRequest, request); - QVERIFY(delegate.lastRequest.url().hasQueryItem("q")); - QCOMPARE(delegate.lastRequest.url().queryItemValue("q"), QString("baz")); + + QUrlQuery q3(delegate.lastRequest.url().query()); + QVERIFY(q3.hasQueryItem("q")); + QCOMPARE(q3.queryItemValue("q"), QString("baz")); QVERIFY(!delegate.lastData.isEmpty()); QStringList query = QString(delegate.lastData).split('&'); diff --git a/autotests/qtest_arora.h b/autotests/qtest_arora.h index b1b194db..2233c7c4 100644 --- a/autotests/qtest_arora.h +++ b/autotests/qtest_arora.h @@ -20,7 +20,7 @@ #ifndef QTEST_ARORA_H #define QTEST_ARORA_H -#include +#include #include diff --git a/autotests/qtry.h b/autotests/qtry.h index 7c1f37cf..fa3539ba 100644 --- a/autotests/qtry.h +++ b/autotests/qtry.h @@ -29,8 +29,6 @@ #ifndef QTRY_H #define QTRY_H -#include - #ifndef QTRY_COMPARE #define __TRY_TIMEOUT__ 5000 diff --git a/autotests/tabbar/tst_tabbar.cpp b/autotests/tabbar/tst_tabbar.cpp index 5b13070b..3e76bbb8 100644 --- a/autotests/tabbar/tst_tabbar.cpp +++ b/autotests/tabbar/tst_tabbar.cpp @@ -19,6 +19,7 @@ #include #include +#include #include class tst_TabBar : public QObject diff --git a/autotests/tabwidget/tst_tabwidget.cpp b/autotests/tabwidget/tst_tabwidget.cpp index 9d90e6d4..a4fb48e1 100644 --- a/autotests/tabwidget/tst_tabwidget.cpp +++ b/autotests/tabwidget/tst_tabwidget.cpp @@ -19,6 +19,8 @@ #include #include +#include +#include #include "qtest_arora.h" #include @@ -250,7 +252,7 @@ void tst_TabWidget::currentLocationBar() QCOMPARE(spy5.count(), 0); QCOMPARE(spy6.count(), 0); */ - QSKIP("Test is not implemented.", SkipAll); + QSKIP("Test is not implemented."); } Q_DECLARE_METATYPE(WebView*) @@ -286,7 +288,7 @@ void tst_TabWidget::currentWebView() QCOMPARE(spy5.count(), 0); QCOMPARE(spy6.count(), 0); */ - QSKIP("Test is not implemented.", SkipAll); + QSKIP("Test is not implemented."); } Q_DECLARE_METATYPE(QWidget*) @@ -322,7 +324,7 @@ void tst_TabWidget::locationBarStack() QCOMPARE(spy5.count(), 0); QCOMPARE(spy6.count(), 0); */ - QSKIP("Test is not implemented.", SkipAll); + QSKIP("Test is not implemented."); } void tst_TabWidget::loadUrl_data() @@ -355,7 +357,7 @@ void tst_TabWidget::loadUrl() QCOMPARE(spy5.count(), 0); QCOMPARE(spy6.count(), 0); */ - QSKIP("Test is not implemented.", SkipAll); + QSKIP("Test is not implemented."); } void tst_TabWidget::newTab_data() @@ -388,7 +390,7 @@ void tst_TabWidget::newTab() QCOMPARE(spy5.count(), 0); QCOMPARE(spy6.count(), 0); */ - QSKIP("Test is not implemented.", SkipAll); + QSKIP("Test is not implemented."); } void tst_TabWidget::nextTab_data() @@ -421,7 +423,7 @@ void tst_TabWidget::nextTab() QCOMPARE(spy5.count(), 0); QCOMPARE(spy6.count(), 0); */ - QSKIP("Test is not implemented.", SkipAll); + QSKIP("Test is not implemented."); } void tst_TabWidget::previousTab_data() @@ -454,7 +456,7 @@ void tst_TabWidget::previousTab() QCOMPARE(spy5.count(), 0); QCOMPARE(spy6.count(), 0); */ - QSKIP("Test is not implemented.", SkipAll); + QSKIP("Test is not implemented."); } void tst_TabWidget::recentlyClosedTabsAction_data() @@ -489,7 +491,7 @@ void tst_TabWidget::recentlyClosedTabsAction() QCOMPARE(spy5.count(), 0); QCOMPARE(spy6.count(), 0); */ - QSKIP("Test is not implemented.", SkipAll); + QSKIP("Test is not implemented."); } void tst_TabWidget::linkHovered_data() @@ -522,7 +524,7 @@ void tst_TabWidget::linkHovered(const QString &) QCOMPARE(spy5.count(), 0); QCOMPARE(spy6.count(), 0); */ - QSKIP("Test is not implemented.", SkipAll); + QSKIP("Test is not implemented."); } void tst_TabWidget::loadProgress_data() @@ -555,7 +557,7 @@ void tst_TabWidget::loadProgress(int) QCOMPARE(spy5.count(), 0); QCOMPARE(spy6.count(), 0); */ - QSKIP("Test is not implemented.", SkipAll); + QSKIP("Test is not implemented."); } void tst_TabWidget::setCurrentTitle_data() @@ -588,7 +590,7 @@ void tst_TabWidget::setCurrentTitle(const QString &) QCOMPARE(spy5.count(), 0); QCOMPARE(spy6.count(), 0); */ - QSKIP("Test is not implemented.", SkipAll); + QSKIP("Test is not implemented."); } void tst_TabWidget::showStatusBarMessage_data() @@ -621,7 +623,7 @@ void tst_TabWidget::showStatusBarMessage(const QString &) QCOMPARE(spy5.count(), 0); QCOMPARE(spy6.count(), 0); */ - QSKIP("Test is not implemented.", SkipAll); + QSKIP("Test is not implemented."); } void tst_TabWidget::tabsChanged_data() @@ -654,7 +656,7 @@ void tst_TabWidget::tabsChanged() QCOMPARE(spy5.count(), 0); QCOMPARE(spy6.count(), 0); */ - QSKIP("Test is not implemented.", SkipAll); + QSKIP("Test is not implemented."); } void tst_TabWidget::saveState() diff --git a/autotests/utils/languagemanager/tst_languagemanager.cpp b/autotests/utils/languagemanager/tst_languagemanager.cpp index f67b862d..414eb1d4 100644 --- a/autotests/utils/languagemanager/tst_languagemanager.cpp +++ b/autotests/utils/languagemanager/tst_languagemanager.cpp @@ -154,7 +154,7 @@ void tst_LanguageManager::chooseNewLanguage() manager.chooseNewLanguage(); #endif - QSKIP("Test is not implemented.", SkipAll); + QSKIP("Test is not implemented."); } void tst_LanguageManager::setCurrentLanguage_data() @@ -173,7 +173,7 @@ void tst_LanguageManager::setCurrentLanguage_data() QString validLanguage = manager.languages().value(0); if (validLanguage.isEmpty()) - QSKIP("no languages to test with", SkipAll); + QSKIP("no languages to test with"); QTest::newRow(validLanguage.toLatin1()) << validLanguage << true << validLanguage; QTest::newRow("fallback") << "ca_ES" << true << "ca_ES"; } diff --git a/autotests/utils/networkaccessmanagerproxy/tst_networkaccessmanagerproxy.cpp b/autotests/utils/networkaccessmanagerproxy/tst_networkaccessmanagerproxy.cpp index 40ed7203..1a72f699 100644 --- a/autotests/utils/networkaccessmanagerproxy/tst_networkaccessmanagerproxy.cpp +++ b/autotests/utils/networkaccessmanagerproxy/tst_networkaccessmanagerproxy.cpp @@ -25,6 +25,7 @@ #include #include #include +#include class tst_NetworkAccessManagerProxy : public QObject { diff --git a/autotests/webactionmapper/tst_webactionmapper.cpp b/autotests/webactionmapper/tst_webactionmapper.cpp index ad78b8dd..742293da 100644 --- a/autotests/webactionmapper/tst_webactionmapper.cpp +++ b/autotests/webactionmapper/tst_webactionmapper.cpp @@ -21,6 +21,7 @@ #include #include #include +#include #include #include diff --git a/autotests/webpage/tst_webpage.cpp b/autotests/webpage/tst_webpage.cpp index 7c70ff3f..facc2ef9 100644 --- a/autotests/webpage/tst_webpage.cpp +++ b/autotests/webpage/tst_webpage.cpp @@ -21,6 +21,7 @@ #include #include #include +#include #include #include "qtest_arora.h" @@ -140,10 +141,10 @@ void tst_WebPage::loadSettings() QCOMPARE(spy0.count(), 0); #endif - QSKIP("Test is not implemented.", SkipAll); + QSKIP("Test is not implemented."); } -Q_DECLARE_METATYPE(WebPluginFactory*) +// Q_DECLARE_METATYPE(WebPluginFactory*) void tst_WebPage::webPluginFactory_data() { #if 0 @@ -166,7 +167,7 @@ void tst_WebPage::webPluginFactory() QCOMPARE(spy0.count(), 0); #endif - QSKIP("Test is not implemented.", SkipAll); + QSKIP("Test is not implemented."); } Q_DECLARE_METATYPE(QWebPage::WebWindowType) @@ -256,7 +257,7 @@ void tst_WebPage::createPlugin() QCOMPARE(spy0.count(), 0); #endif - QSKIP("Test is not implemented.", SkipAll); + QSKIP("Test is not implemented."); } Q_DECLARE_METATYPE(QWebPage*) @@ -284,7 +285,7 @@ void tst_WebPage::createWindow() QCOMPARE(spy0.count(), 0); #endif - QSKIP("Test is not implemented.", SkipAll); + QSKIP("Test is not implemented."); } void tst_WebPage::handleUnsupportedContent() diff --git a/src/.qmake.conf b/src/.qmake.conf new file mode 100644 index 00000000..7c1d952d --- /dev/null +++ b/src/.qmake.conf @@ -0,0 +1,2 @@ +QMAKEPATH += /usr/local/opt/qtwebkit +QMAKE_MAC_SDK = macosx10.13 diff --git a/src/aboutdialog.cpp b/src/aboutdialog.cpp index 42e1c814..28d0d74f 100644 --- a/src/aboutdialog.cpp +++ b/src/aboutdialog.cpp @@ -27,8 +27,9 @@ #include #include -#if QT_VERSION >= 0x040600 || defined(WEBKIT_TRUNK) -#include +#if QT_VERSION >= 0x050000 || defined(WEBKIT_TRUNK) +#include +#include #endif AboutDialog::AboutDialog(QWidget *parent) @@ -39,7 +40,7 @@ AboutDialog::AboutDialog(QWidget *parent) logo->setPixmap(qApp->windowIcon().pixmap(128, 128)); name->setText(qApp->applicationName()); version->setText(qApp->applicationVersion()); -#if QT_VERSION >= 0x040600 || defined(WEBKIT_TRUNK) +#if QT_VERSION >= 0x050000 || defined(WEBKIT_TRUNK) webkitVersion->setText(tr("WebKit version: %1").arg(qWebKitVersion())); #else webkitVersion->hide(); diff --git a/src/aboutdialog.h b/src/aboutdialog.h index 4f4b7b01..f245be31 100644 --- a/src/aboutdialog.h +++ b/src/aboutdialog.h @@ -39,4 +39,3 @@ private slots: }; #endif // ABOUTDIALOG_H - diff --git a/src/adblock/adblock.pri b/src/adblock/adblock.pri index c373a684..9cce5388 100644 --- a/src/adblock/adblock.pri +++ b/src/adblock/adblock.pri @@ -1,6 +1,8 @@ INCLUDEPATH += $$PWD DEPENDPATH += $$PWD +VPATH += $$PWD + HEADERS += \ adblockblockednetworkreply.h \ adblockdialog.h \ @@ -25,4 +27,3 @@ SOURCES += \ FORMS += \ adblockdialog.ui - diff --git a/src/adblock/adblockmanager.cpp b/src/adblock/adblockmanager.cpp index 959f880d..8cf39642 100644 --- a/src/adblock/adblockmanager.cpp +++ b/src/adblock/adblockmanager.cpp @@ -85,6 +85,7 @@ void AdBlockManager::setEnabled(bool enabled) { if (isEnabled() == enabled) return; + emit rulesGoingToChange(); m_enabled = enabled; emit rulesChanged(); } @@ -149,6 +150,7 @@ void AdBlockManager::removeSubscription(AdBlockSubscription *subscription) qDebug() << "AdBlockManager::" << __FUNCTION__ << subscription->location(); #endif m_saveTimer->saveIfNeccessary(); + emit rulesGoingToChange(); m_subscriptions.removeOne(subscription); if (subscription->parent() == this) subscription->deleteLater(); @@ -162,7 +164,9 @@ void AdBlockManager::addSubscription(AdBlockSubscription *subscription) #if defined(ADBLOCKMANAGER_DEBUG) qDebug() << "AdBlockManager::" << __FUNCTION__ << subscription->location(); #endif + emit rulesGoingToChange(); m_subscriptions.append(subscription); + connect(subscription, SIGNAL(goingToChange()), this, SIGNAL(rulesGoingToChange())); connect(subscription, SIGNAL(rulesChanged()), this, SIGNAL(rulesChanged())); connect(subscription, SIGNAL(changed()), this, SIGNAL(rulesChanged())); emit rulesChanged(); @@ -211,6 +215,7 @@ void AdBlockManager::load() foreach (const QString &subscription, subscriptions) { QUrl url = QUrl::fromEncoded(subscription.toUtf8()); AdBlockSubscription *adBlockSubscription = new AdBlockSubscription(url, this); + connect(adBlockSubscription, SIGNAL(goingToChange()), this, SIGNAL(rulesGoingToChange())); connect(adBlockSubscription, SIGNAL(rulesChanged()), this, SIGNAL(rulesChanged())); connect(adBlockSubscription, SIGNAL(changed()), this, SIGNAL(rulesChanged())); m_subscriptions.append(adBlockSubscription); diff --git a/src/adblock/adblockmanager.h b/src/adblock/adblockmanager.h index d16e3bf3..af021239 100644 --- a/src/adblock/adblockmanager.h +++ b/src/adblock/adblockmanager.h @@ -44,6 +44,7 @@ class AdBlockManager : public QObject Q_OBJECT signals: + void rulesGoingToChange(); void rulesChanged(); public: diff --git a/src/adblock/adblockmodel.cpp b/src/adblock/adblockmodel.cpp index 1b5ba2d3..61f3970a 100644 --- a/src/adblock/adblockmodel.cpp +++ b/src/adblock/adblockmodel.cpp @@ -37,11 +37,17 @@ AdBlockModel::AdBlockModel(QObject *parent) , m_manager(AdBlockManager::instance()) { connect(m_manager, SIGNAL(rulesChanged()), this, SLOT(rulesChanged())); + connect(m_manager, SIGNAL(rulesGoingToChange()), this, SLOT(rulesGoingToChange())); +} + +void AdBlockModel::rulesGoingToChange() +{ + beginResetModel(); } void AdBlockModel::rulesChanged() { - reset(); + endResetModel(); } const AdBlockRule AdBlockModel::rule(const QModelIndex &index) const @@ -67,7 +73,7 @@ QModelIndex AdBlockModel::index(AdBlockSubscription *subscription) int row = m_manager->subscriptions().indexOf(subscription); if (row < 0 || row >= m_manager->subscriptions().count()) return QModelIndex(); - return createIndex(row, 0, 0); + return createIndex(row, 0, (void*) 0); } QVariant AdBlockModel::headerData(int section, Qt::Orientation orientation, int role) const @@ -159,7 +165,7 @@ QModelIndex AdBlockModel::parent(const QModelIndex &index) const return QModelIndex(); int parentRow = m_manager->subscriptions().indexOf(parent); - return createIndex(parentRow, 0, 0); + return createIndex(parentRow, 0, (void*)0); } Qt::ItemFlags AdBlockModel::flags(const QModelIndex &index) const diff --git a/src/adblock/adblockmodel.h b/src/adblock/adblockmodel.h index 36066211..c3959bbc 100644 --- a/src/adblock/adblockmodel.h +++ b/src/adblock/adblockmodel.h @@ -57,6 +57,7 @@ class AdBlockModel : public QAbstractItemModel QModelIndex index(AdBlockSubscription *subscription); private slots: + void rulesGoingToChange(); void rulesChanged(); private: diff --git a/src/adblock/adblocksubscription.cpp b/src/adblock/adblocksubscription.cpp index d28c590d..798090a9 100644 --- a/src/adblock/adblocksubscription.cpp +++ b/src/adblock/adblocksubscription.cpp @@ -36,6 +36,7 @@ #include #include #include +#include // #define ADBLOCKSUBSCRIPTION_DEBUG @@ -57,12 +58,11 @@ void AdBlockSubscription::parseUrl(const QUrl &url) return; if (url.path() != QLatin1String("subscribe")) return; - - m_title = QUrl::fromPercentEncoding(url.encodedQueryItemValue("title")); - m_enabled = QUrl::fromPercentEncoding(url.encodedQueryItemValue("enabled")) != QLatin1String("false"); - m_location = QUrl::fromPercentEncoding(url.encodedQueryItemValue("location")).toUtf8(); - QByteArray lastUpdateByteArray = url.encodedQueryItemValue("lastUpdate"); - QString lastUpdateString = QUrl::fromPercentEncoding(lastUpdateByteArray); + QUrlQuery query(url.query()); + m_title = query.queryItemValue("title"); + m_enabled = query.queryItemValue("enabled") != QLatin1String("false"); + m_location = query.queryItemValue("location").toUtf8(); + QString lastUpdateString = query.queryItemValue("lastUpdate"); m_lastUpdate = QDateTime::fromString(lastUpdateString, Qt::ISODate); loadRules(); } @@ -73,16 +73,15 @@ QUrl AdBlockSubscription::url() const url.setScheme(QLatin1String("abp")); url.setPath(QLatin1String("subscribe")); - typedef QPair Query; - QList queryItems; + QUrlQuery queryItems; - queryItems.append(Query(QLatin1String("location"), QString::fromUtf8(m_location))); - queryItems.append(Query(QLatin1String("title"), m_title)); + queryItems.addQueryItem(QLatin1String("location"), QString::fromUtf8(m_location)); + queryItems.addQueryItem(QLatin1String("title"), m_title); if (!m_enabled) - queryItems.append(Query(QLatin1String("enabled"), QLatin1String("false"))); + queryItems.addQueryItem(QLatin1String("enabled"), QLatin1String("false")); if (m_lastUpdate.isValid()) - queryItems.append(Query(QLatin1String("lastUpdate"), m_lastUpdate.toString(Qt::ISODate))); - url.setQueryItems(queryItems); + queryItems.addQueryItem(QLatin1String("lastUpdate"), m_lastUpdate.toString(Qt::ISODate)); + url.setQuery(queryItems); return url; } diff --git a/src/adblock/adblocksubscription.h b/src/adblock/adblocksubscription.h index 43639a47..8813bbfc 100644 --- a/src/adblock/adblocksubscription.h +++ b/src/adblock/adblocksubscription.h @@ -43,6 +43,7 @@ class AdBlockSubscription : public QObject Q_OBJECT signals: + void goingToChange(); void changed(); void rulesChanged(); diff --git a/src/autofilldialog.cpp b/src/autofilldialog.cpp index 7e1acd14..66f9db40 100644 --- a/src/autofilldialog.cpp +++ b/src/autofilldialog.cpp @@ -44,9 +44,10 @@ AutoFillModel::AutoFillModel(QObject *parent) void AutoFillModel::autoFillChanged() { + beginResetModel(); AutoFillManager *manager = BrowserApplication::instance()->autoFillManager(); m_forms = manager->forms(); - reset(); + endResetModel(); } QVariant AutoFillModel::headerData(int section, Qt::Orientation orientation, int role) const diff --git a/src/autofillmanager.cpp b/src/autofillmanager.cpp index b4c713ed..f99992de 100644 --- a/src/autofillmanager.cpp +++ b/src/autofillmanager.cpp @@ -43,6 +43,7 @@ #include #include #include +#include #include @@ -91,7 +92,7 @@ void AutoFillManager::loadSettings() QString AutoFillManager::autoFillDataFile() { - QString fileName = QDesktopServices::storageLocation(QDesktopServices::DataLocation); + QString fileName = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + "/data/Arora"; fileName += QLatin1String("/autofill.dat"); return fileName; } @@ -226,7 +227,7 @@ void AutoFillManager::post(const QNetworkRequest &request, const QByteArray &out AutoFillManager::Form AutoFillManager::findForm(QWebPage *webPage, const QByteArray &outgoingData) const { Form form; - QUrl argsUrl = QUrl::fromEncoded(QByteArray("foo://bar.com/?" + outgoingData)); + QUrlQuery argsUrl(outgoingData); QList > encodedArgs = argsUrl.queryItems(); QSet > args; // XXX Is there a Qt function to do this? (unencode '+' to ' ') @@ -293,7 +294,7 @@ AutoFillManager::Form AutoFillManager::findForm(QWebPage *webPage, const QByteAr QUrl AutoFillManager::stripUrl(const QUrl &url) { QUrl cleanUrl = url; - cleanUrl.setQueryItems(QList >()); + cleanUrl.setQuery(QUrlQuery()); cleanUrl.setFragment(QString()); cleanUrl.setUserInfo(QString()); return cleanUrl; @@ -415,4 +416,3 @@ void AutoFillManager::Form::save(QDataStream &out, const AutoFillManager::Form & out << form.name; out << form.hasAPassword; } - diff --git a/src/bookmarks/bookmarks.pri b/src/bookmarks/bookmarks.pri index ee03defd..34f899e6 100644 --- a/src/bookmarks/bookmarks.pri +++ b/src/bookmarks/bookmarks.pri @@ -1,5 +1,6 @@ INCLUDEPATH += $$PWD DEPENDPATH += $$PWD +VPATH += $$PWD HEADERS += \ addbookmarkdialog.h \ diff --git a/src/bookmarks/bookmarksmanager.cpp b/src/bookmarks/bookmarksmanager.cpp index 8db5abfc..c8310410 100644 --- a/src/bookmarks/bookmarksmanager.cpp +++ b/src/bookmarks/bookmarksmanager.cpp @@ -123,7 +123,7 @@ void BookmarksManager::load() return; m_loaded = true; - QString dir = QDesktopServices::storageLocation(QDesktopServices::DataLocation); + QString dir = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + "/data/Arora"; QString bookmarkFile = dir + QLatin1String("/bookmarks.xbel"); if (!QFile::exists(bookmarkFile)) bookmarkFile = QLatin1String(":defaultbookmarks.xbel"); @@ -184,7 +184,7 @@ void BookmarksManager::save() const return; XbelWriter writer; - QString dir = QDesktopServices::storageLocation(QDesktopServices::DataLocation); + QString dir = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + "/data/Arora"; QString bookmarkFile = dir + QLatin1String("/bookmarks.xbel"); // Save root folder titles in English (i.e. not localized) m_menu->title = QLatin1String(BOOKMARKMENU); diff --git a/src/bookmarks/bookmarksmodel.cpp b/src/bookmarks/bookmarksmodel.cpp index b6f28693..029d6276 100644 --- a/src/bookmarks/bookmarksmodel.cpp +++ b/src/bookmarks/bookmarksmodel.cpp @@ -71,6 +71,8 @@ #include #include +#include + BookmarksModel::BookmarksModel(BookmarksManager *bookmarkManager, QObject *parent) : QAbstractItemModel(parent) diff --git a/src/bookmarks/xbel/xbel.pri b/src/bookmarks/xbel/xbel.pri index 02b0258f..7615d5d3 100644 --- a/src/bookmarks/xbel/xbel.pri +++ b/src/bookmarks/xbel/xbel.pri @@ -1,5 +1,6 @@ INCLUDEPATH += $$PWD DEPENDPATH += $$PWD +VPATH += $$PWD HEADERS += \ xbelreader.h \ diff --git a/src/browserapplication.cpp b/src/browserapplication.cpp index 4514a803..2256b58a 100644 --- a/src/browserapplication.cpp +++ b/src/browserapplication.cpp @@ -303,9 +303,7 @@ void BrowserApplication::quitBrowser() */ void BrowserApplication::postLaunch() { - QDesktopServices::StandardLocation location; - location = QDesktopServices::CacheLocation; - QString directory = QDesktopServices::storageLocation(location); + QString directory = QStandardPaths::writableLocation(QStandardPaths::CacheLocation); if (directory.isEmpty()) directory = QDir::homePath() + QLatin1String("/.") + QCoreApplication::applicationName(); QWebSettings::setIconDatabasePath(directory); @@ -356,7 +354,7 @@ void BrowserApplication::loadSettings() QString standardFontFamily = defaultSettings->fontFamily(QWebSettings::StandardFont); int standardFontSize = defaultSettings->fontSize(QWebSettings::DefaultFontSize); QFont standardFont = QFont(standardFontFamily, standardFontSize); - standardFont = qVariantValue(settings.value(QLatin1String("standardFont"), standardFont)); + standardFont = settings.value(QLatin1String("standardFont"), standardFont).value(); defaultSettings->setFontFamily(QWebSettings::StandardFont, standardFont.family()); defaultSettings->setFontSize(QWebSettings::DefaultFontSize, standardFont.pointSize()); int minimumFontSize = settings.value(QLatin1String("minimumFontSize"), @@ -366,7 +364,7 @@ void BrowserApplication::loadSettings() QString fixedFontFamily = defaultSettings->fontFamily(QWebSettings::FixedFont); int fixedFontSize = defaultSettings->fontSize(QWebSettings::DefaultFixedFontSize); QFont fixedFont = QFont(fixedFontFamily, fixedFontSize); - fixedFont = qVariantValue(settings.value(QLatin1String("fixedFont"), fixedFont)); + fixedFont = settings.value(QLatin1String("fixedFont"), fixedFont).value(); defaultSettings->setFontFamily(QWebSettings::FixedFont, fixedFont.family()); defaultSettings->setFontSize(QWebSettings::DefaultFixedFontSize, fixedFont.pointSize()); @@ -658,7 +656,7 @@ QString BrowserApplication::installedDataDirectory() QString BrowserApplication::dataFilePath(const QString &fileName) { - QString directory = QDesktopServices::storageLocation(QDesktopServices::DataLocation); + QString directory = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + "/data/Arora"; if (directory.isEmpty()) directory = QDir::homePath() + QLatin1String("/.") + QCoreApplication::applicationName(); if (!QFile::exists(directory)) { diff --git a/src/downloadmanager.cpp b/src/downloadmanager.cpp index 81963535..ad6bb759 100644 --- a/src/downloadmanager.cpp +++ b/src/downloadmanager.cpp @@ -471,7 +471,7 @@ DownloadManager::DownloadManager(QWidget *parent) QSettings settings; settings.beginGroup(QLatin1String("downloadmanager")); - QString defaultLocation = QDesktopServices::storageLocation(QDesktopServices::DesktopLocation); + QString defaultLocation = QStandardPaths::writableLocation(QStandardPaths::DesktopLocation); setDownloadDirectory(settings.value(QLatin1String("downloadDirectory"), defaultLocation).toString()); downloadsView->setShowGrid(false); @@ -601,9 +601,9 @@ void DownloadManager::updateActiveItemCount() { int acCount = activeDownloads(); if (acCount > 0) { - setWindowTitle(QApplication::translate("DownloadDialog", "Downloading %1", 0, QApplication::UnicodeUTF8).arg(acCount)); + setWindowTitle(QApplication::translate("DownloadDialog", "Downloading %1", 0).arg(acCount)); } else { - setWindowTitle(QApplication::translate("DownloadDialog", "Downloads", 0, QApplication::UnicodeUTF8)); + setWindowTitle(QApplication::translate("DownloadDialog", "Downloads", 0)); } } diff --git a/src/history/history.cpp b/src/history/history.cpp index 7419cf00..bda2261f 100644 --- a/src/history/history.cpp +++ b/src/history/history.cpp @@ -91,6 +91,7 @@ HistoryModel::HistoryModel(HistoryManager *history, QObject *parent) , m_history(history) { Q_ASSERT(m_history); + connect(m_history, SIGNAL(historyGoingToChange()), this, SLOT(historyGoingToChange())); connect(m_history, SIGNAL(historyReset()), this, SLOT(historyReset())); connect(m_history, SIGNAL(entryRemoved(const HistoryEntry &)), @@ -104,7 +105,12 @@ HistoryModel::HistoryModel(HistoryManager *history, QObject *parent) void HistoryModel::historyReset() { - reset(); + endResetModel(); +} + +void HistoryModel::historyGoingToChange() +{ + beginResetModel(); } void HistoryModel::entryAdded() @@ -557,8 +563,9 @@ void HistoryFilterModel::recalculateFrecencies() void HistoryFilterModel::sourceReset() { + beginResetModel(); m_loaded = false; - reset(); + endResetModel(); } int HistoryFilterModel::rowCount(const QModelIndex &parent) const @@ -681,11 +688,11 @@ bool HistoryFilterModel::removeRows(int row, int count, const QModelIndex &paren { if (row < 0 || count <= 0 || row + count > rowCount(parent) || parent.isValid()) return false; + beginResetModel(); int lastRow = row + count - 1; disconnect(sourceModel(), SIGNAL(rowsRemoved(const QModelIndex &, int, int)), this, SLOT(sourceRowsRemoved(const QModelIndex &, int, int))); beginRemoveRows(parent, row, lastRow); - int oldCount = rowCount(); int start = sourceModel()->rowCount() - m_filteredRows[row].tailOffset; int end = sourceModel()->rowCount() - m_filteredRows[lastRow].tailOffset; sourceModel()->removeRows(start, end - start + 1); @@ -693,8 +700,7 @@ bool HistoryFilterModel::removeRows(int row, int count, const QModelIndex &paren connect(sourceModel(), SIGNAL(rowsRemoved(const QModelIndex &, int, int)), this, SLOT(sourceRowsRemoved(const QModelIndex &, int, int))); m_loaded = false; - if (oldCount - count != rowCount()) - reset(); + endResetModel(); return true; } @@ -838,7 +844,7 @@ QModelIndex HistoryTreeModel::index(int row, int column, const QModelIndex &pare return QModelIndex(); if (!parent.isValid()) - return createIndex(row, column, 0); + return createIndex(row, column, (void*) 0); return createIndex(row, column, parent.row() + 1); } @@ -847,7 +853,7 @@ QModelIndex HistoryTreeModel::parent(const QModelIndex &index) const int offset = index.internalId(); if (offset == 0 || !index.isValid()) return QModelIndex(); - return createIndex(offset - 1, 0, 0); + return createIndex(offset - 1, 0, (void*) 0); } bool HistoryTreeModel::hasChildren(const QModelIndex &parent) const @@ -867,6 +873,8 @@ Qt::ItemFlags HistoryTreeModel::flags(const QModelIndex &index) const void HistoryTreeModel::setSourceModel(QAbstractItemModel *newSourceModel) { + beginResetModel(); + if (sourceModel()) { disconnect(sourceModel(), SIGNAL(modelReset()), this, SLOT(sourceReset())); disconnect(sourceModel(), SIGNAL(layoutChanged()), this, SLOT(sourceReset())); @@ -887,13 +895,14 @@ void HistoryTreeModel::setSourceModel(QAbstractItemModel *newSourceModel) this, SLOT(sourceRowsRemoved(const QModelIndex &, int, int))); } - reset(); + endResetModel(); } void HistoryTreeModel::sourceReset() { + beginResetModel(); m_sourceRowCache.clear(); - reset(); + endResetModel(); } void HistoryTreeModel::sourceRowsInserted(const QModelIndex &parent, int start, int end) @@ -901,8 +910,9 @@ void HistoryTreeModel::sourceRowsInserted(const QModelIndex &parent, int start, Q_UNUSED(parent); // Avoid warnings when compiling release Q_ASSERT(!parent.isValid()); if (start != 0 || start != end) { + beginResetModel(); m_sourceRowCache.clear(); - reset(); + endResetModel(); return; } @@ -964,8 +974,9 @@ bool HistoryTreeModel::removeRows(int row, int count, const QModelIndex &parent) void HistoryTreeModel::sourceRowsRemoved(const QModelIndex &parent, int start, int end) { if (!removingDown) { - reset(); + beginResetModel(); m_sourceRowCache.clear(); + endResetModel(); return; } Q_UNUSED(parent); // Avoid warnings when compiling release diff --git a/src/history/history.h b/src/history/history.h index 84e596f7..9e49a5eb 100644 --- a/src/history/history.h +++ b/src/history/history.h @@ -81,6 +81,7 @@ class HistoryModel : public QAbstractTableModel public slots: void historyReset(); + void historyGoingToChange(); void entryAdded(); void entryUpdated(int offset); diff --git a/src/history/history.pri b/src/history/history.pri index 6ee163dd..96ff3e59 100644 --- a/src/history/history.pri +++ b/src/history/history.pri @@ -1,5 +1,6 @@ INCLUDEPATH += $$PWD DEPENDPATH += $$PWD +VPATH += $$PWD HEADERS += \ history.h \ @@ -13,4 +14,3 @@ SOURCES += \ FORMS += \ history.ui - diff --git a/src/history/historymanager.cpp b/src/history/historymanager.cpp index 87c0cf53..ee90547f 100644 --- a/src/history/historymanager.cpp +++ b/src/history/historymanager.cpp @@ -145,6 +145,7 @@ void HistoryManager::addHistoryEntry(const QString &url) void HistoryManager::setHistory(const QList &history, bool loadedAndSorted) { + emit historyGoingToChange(); m_history = history; // verify that it is sorted by date @@ -266,6 +267,7 @@ void HistoryManager::setDaysToExpire(int limit) void HistoryManager::clear() { + emit historyGoingToChange(); m_history.clear(); m_atomicStringHash.clear(); m_lastSavedUrl.clear(); @@ -413,4 +415,4 @@ void HistoryManager::save() qWarning() << "History: error moving new history over old." << tempFile.errorString() << historyFile.fileName(); } m_lastSavedUrl = m_history.value(0).url; -} \ No newline at end of file +} diff --git a/src/history/historymanager.h b/src/history/historymanager.h index 13c0854f..83636266 100644 --- a/src/history/historymanager.h +++ b/src/history/historymanager.h @@ -104,6 +104,7 @@ class HistoryManager : public QWebHistoryInterface signals: void historyCleared(); + void historyGoingToChange(); void historyReset(); void entryAdded(const HistoryEntry &item); void entryRemoved(const HistoryEntry &item); diff --git a/src/locale/locale.pri b/src/locale/locale.pri index d1776979..37dfb40e 100644 --- a/src/locale/locale.pri +++ b/src/locale/locale.pri @@ -1,6 +1,7 @@ INCLUDEPATH += $$PWD DEPENDPATH += $$PWD +VPATH += $$PWD TRANSLATIONS += \ ast.ts \ diff --git a/src/locationbar/locationbar.cpp b/src/locationbar/locationbar.cpp index c9f53358..10cf4514 100644 --- a/src/locationbar/locationbar.cpp +++ b/src/locationbar/locationbar.cpp @@ -30,6 +30,7 @@ #include #include #include +#include #include diff --git a/src/locationbar/locationbar.pri b/src/locationbar/locationbar.pri index ba33005d..0e833656 100644 --- a/src/locationbar/locationbar.pri +++ b/src/locationbar/locationbar.pri @@ -1,5 +1,6 @@ INCLUDEPATH += $$PWD DEPENDPATH += $$PWD +VPATH += $$PWD HEADERS += \ locationbar.h \ @@ -10,4 +11,3 @@ SOURCES += \ locationbar.cpp \ locationbarsiteicon.cpp \ privacyindicator.cpp - diff --git a/src/locationbar/locationbarsiteicon.cpp b/src/locationbar/locationbarsiteicon.cpp index f5947006..7a9d0d6f 100644 --- a/src/locationbar/locationbarsiteicon.cpp +++ b/src/locationbar/locationbarsiteicon.cpp @@ -21,6 +21,8 @@ #include #include +#include +#include #include "browserapplication.h" #include "webview.h" diff --git a/src/modelmenu.cpp b/src/modelmenu.cpp index 4f95d090..3739d4be 100644 --- a/src/modelmenu.cpp +++ b/src/modelmenu.cpp @@ -68,6 +68,9 @@ #include #include #include +#include +#include +#include #include @@ -344,7 +347,8 @@ void ModelMenu::mouseMoveEvent(QMouseEvent *event) if (drag->exec() == Qt::MoveAction) { m_model->removeRow(idx.row(), m_root); - if (!this->isAncestorOf(drag->target())) + QWidget *target = static_cast(drag->target()); + if (!this->isAncestorOf(target)) close(); else aboutToShow(); diff --git a/src/modeltoolbar.cpp b/src/modeltoolbar.cpp index 12b77b9c..4f0e816c 100644 --- a/src/modeltoolbar.cpp +++ b/src/modeltoolbar.cpp @@ -24,6 +24,9 @@ #include #include +#include +#include + ModelToolBar::ModelToolBar(QWidget *parent) : QToolBar(parent) diff --git a/src/network/cookiejar/cookieexceptionsmodel.cpp b/src/network/cookiejar/cookieexceptionsmodel.cpp index 6e45d2aa..d71fe687 100644 --- a/src/network/cookiejar/cookieexceptionsmodel.cpp +++ b/src/network/cookiejar/cookieexceptionsmodel.cpp @@ -201,6 +201,7 @@ void CookieExceptionsModel::addRule(QString host, CookieJar::CookieRule rule) void CookieExceptionsModel::addHost(QString host, QStringList &add, QStringList &remove1, QStringList &remove2) { + beginResetModel(); if (!add.contains(host)) { add.append(host); remove1.removeOne(host); @@ -217,6 +218,6 @@ void CookieExceptionsModel::addHost(QString host, QStringList &add, QStringList add.removeOne(otherRule); remove1.removeOne(otherRule); remove2.removeOne(otherRule); - reset(); + endResetModel(); } diff --git a/src/network/cookiejar/cookiejar.cpp b/src/network/cookiejar/cookiejar.cpp index 532600a2..e761558a 100644 --- a/src/network/cookiejar/cookiejar.cpp +++ b/src/network/cookiejar/cookiejar.cpp @@ -70,6 +70,8 @@ #include #include #include +#include +#include #include @@ -489,4 +491,3 @@ void CookieJar::setFilterTrackingCookies(bool filterTrackingCookies) { this->m_filterTrackingCookies = filterTrackingCookies; } - diff --git a/src/network/cookiejar/cookiejar.pri b/src/network/cookiejar/cookiejar.pri index 8ecf5338..62612d3a 100644 --- a/src/network/cookiejar/cookiejar.pri +++ b/src/network/cookiejar/cookiejar.pri @@ -1,5 +1,6 @@ INCLUDEPATH += $$PWD DEPENDPATH += $$PWD +VPATH += $$PWD HEADERS += \ cookiedialog.h \ @@ -20,4 +21,3 @@ FORMS += \ cookiesexceptions.ui include($$PWD/networkcookiejar/networkcookiejar.pri) - diff --git a/src/network/cookiejar/cookiemodel.cpp b/src/network/cookiejar/cookiemodel.cpp index 391e2cc7..5c123179 100644 --- a/src/network/cookiejar/cookiemodel.cpp +++ b/src/network/cookiejar/cookiemodel.cpp @@ -194,7 +194,8 @@ bool CookieModel::removeRows(int row, int count, const QModelIndex &parent) void CookieModel::cookiesChanged() { + beginResetModel(); if (m_cookieJar) m_cookies = m_cookieJar->cookies(); - reset(); + endResetModel(); } diff --git a/src/network/cookiejar/networkcookiejar/networkcookiejar.cpp b/src/network/cookiejar/networkcookiejar/networkcookiejar.cpp index 940269d5..d71650ea 100644 --- a/src/network/cookiejar/networkcookiejar/networkcookiejar.cpp +++ b/src/network/cookiejar/networkcookiejar/networkcookiejar.cpp @@ -37,6 +37,7 @@ #include "networkcookiejar.h" #include "networkcookiejar_p.h" #include "twoleveldomains_p.h" +#include //#define NETWORKCOOKIEJAR_DEBUG @@ -372,4 +373,3 @@ void NetworkCookieJar::setSecondLevelDomains(const QStringList &secondLevelDomai d->secondLevelDomains = secondLevelDomains; qSort(d->secondLevelDomains); } - diff --git a/src/network/cookiejar/networkcookiejar/networkcookiejar.h b/src/network/cookiejar/networkcookiejar/networkcookiejar.h index 365b4a32..bc6bfb85 100644 --- a/src/network/cookiejar/networkcookiejar/networkcookiejar.h +++ b/src/network/cookiejar/networkcookiejar/networkcookiejar.h @@ -37,7 +37,7 @@ #ifndef NETWORKCOOKIEJAR_H #define NETWORKCOOKIEJAR_H -#include +#include class NetworkCookieJarPrivate; class NetworkCookieJar : public QNetworkCookieJar { diff --git a/src/network/cookiejar/networkcookiejar/networkcookiejar.pri b/src/network/cookiejar/networkcookiejar/networkcookiejar.pri index 78ac273a..8b150bf1 100644 --- a/src/network/cookiejar/networkcookiejar/networkcookiejar.pri +++ b/src/network/cookiejar/networkcookiejar/networkcookiejar.pri @@ -1,5 +1,6 @@ INCLUDEPATH += $$PWD DEPENDPATH += $$PWD +VPATH += $$PWD HEADERS += trie_p.h networkcookiejar.h twoleveldomains_p.h networkcookiejar_p.h SOURCES += networkcookiejar.cpp diff --git a/src/network/cookiejar/networkcookiejar/networkcookiejar_p.h b/src/network/cookiejar/networkcookiejar/networkcookiejar_p.h index ea357375..677efc66 100644 --- a/src/network/cookiejar/networkcookiejar/networkcookiejar_p.h +++ b/src/network/cookiejar/networkcookiejar/networkcookiejar_p.h @@ -38,6 +38,7 @@ #define NETWORKCOOKIEJARPRIVATE_H #include "trie_p.h" +#include QT_BEGIN_NAMESPACE QDataStream &operator<<(QDataStream &stream, const QNetworkCookie &cookie) diff --git a/src/network/network.pri b/src/network/network.pri index 5c912f44..a6c7a30c 100644 --- a/src/network/network.pri +++ b/src/network/network.pri @@ -1,5 +1,6 @@ INCLUDEPATH += $$PWD DEPENDPATH += $$PWD +VPATH += $$PWD FORMS += \ passworddialog.ui \ diff --git a/src/network/networkaccessmanager.cpp b/src/network/networkaccessmanager.cpp index 56fb343d..e7c14794 100644 --- a/src/network/networkaccessmanager.cpp +++ b/src/network/networkaccessmanager.cpp @@ -213,7 +213,7 @@ void NetworkAccessManager::authenticationRequired(QNetworkReply *reply, QAuthent passwordDialog.iconLabel->setPixmap(mainWindow->style()->standardIcon(QStyle::SP_MessageBoxQuestion, 0, mainWindow).pixmap(32, 32)); QString introMessage = tr("Enter username and password for \"%1\" at %2"); - introMessage = introMessage.arg(Qt::escape(auth->realm())).arg(Qt::escape(reply->url().toString())); + introMessage = introMessage.arg(QString(auth->realm()).toHtmlEscaped().arg(reply->url().toString().toHtmlEscaped())); passwordDialog.introLabel->setText(introMessage); passwordDialog.introLabel->setWordWrap(true); @@ -240,7 +240,7 @@ void NetworkAccessManager::proxyAuthenticationRequired(const QNetworkProxy &prox proxyDialog.iconLabel->setPixmap(mainWindow->style()->standardIcon(QStyle::SP_MessageBoxQuestion, 0, mainWindow).pixmap(32, 32)); QString introMessage = tr("Connect to proxy \"%1\" using:"); - introMessage = introMessage.arg(Qt::escape(proxy.hostName())); + introMessage = introMessage.arg(QString(proxy.hostName()).toHtmlEscaped()); proxyDialog.introLabel->setText(introMessage); proxyDialog.introLabel->setWordWrap(true); @@ -255,11 +255,13 @@ QString NetworkAccessManager::certToFormattedString(QSslCertificate cert) { QStringList message; message << cert.subjectInfo(QSslCertificate::CommonName); - message << tr("Issuer: %1").arg(cert.issuerInfo(QSslCertificate::CommonName)); + foreach (QString issuer, cert.issuerInfo(QSslCertificate::CommonName)) { + message << tr("Issuer: %1").arg(issuer.toHtmlEscaped()); + } message << tr("Not valid before: %1").arg(cert.effectiveDate().toString()); message << tr("Valid until: %1").arg(cert.expiryDate().toString()); - QMultiMap names = cert.alternateSubjectNames(); + QMultiMap names = cert.subjectAlternativeNames(); if (names.count() > 0) { QString list; list += QLatin1String("
"); diff --git a/src/network/networkdiskcache.cpp b/src/network/networkdiskcache.cpp index cfd0d77b..c3acd626 100644 --- a/src/network/networkdiskcache.cpp +++ b/src/network/networkdiskcache.cpp @@ -37,7 +37,7 @@ NetworkDiskCache::NetworkDiskCache(QObject *parent) : QNetworkDiskCache(parent) , m_private(false) { - QString diskCacheDirectory = QDesktopServices::storageLocation(QDesktopServices::CacheLocation) + QString diskCacheDirectory = QStandardPaths::writableLocation(QStandardPaths::CacheLocation) + QLatin1String("/browser"); setCacheDirectory(diskCacheDirectory); connect(BrowserApplication::instance(), SIGNAL(privacyChanged(bool)), diff --git a/src/opensearch/opensearch.pri b/src/opensearch/opensearch.pri index dbace745..e46dda23 100644 --- a/src/opensearch/opensearch.pri +++ b/src/opensearch/opensearch.pri @@ -1,5 +1,6 @@ INCLUDEPATH += $$PWD DEPENDPATH += $$PWD +VPATH += $$PWD HEADERS += \ opensearchdialog.h \ diff --git a/src/opensearch/opensearchengine.cpp b/src/opensearch/opensearchengine.cpp index 0332fc16..b979917a 100644 --- a/src/opensearch/opensearchengine.cpp +++ b/src/opensearch/opensearchengine.cpp @@ -27,9 +27,9 @@ #include #include #include -#include -#include #include +#include +#include /*! \class OpenSearchEngine @@ -206,13 +206,15 @@ QUrl OpenSearchEngine::searchUrl(const QString &searchTerm) const return QUrl(); QUrl retVal = QUrl::fromEncoded(parseTemplate(searchTerm, m_searchUrlTemplate).toUtf8()); + QUrlQuery query(retVal.query()); if (m_searchMethod != QLatin1String("post")) { Parameters::const_iterator end = m_searchParameters.constEnd(); Parameters::const_iterator i = m_searchParameters.constBegin(); for (; i != end; ++i) - retVal.addQueryItem(i->first, parseTemplate(searchTerm, i->second)); + query.addQueryItem(i->first, parseTemplate(searchTerm, i->second)); } + retVal.setQuery(query); return retVal; } @@ -258,13 +260,15 @@ QUrl OpenSearchEngine::suggestionsUrl(const QString &searchTerm) const return QUrl(); QUrl retVal = QUrl::fromEncoded(parseTemplate(searchTerm, m_suggestionsUrlTemplate).toUtf8()); + QUrlQuery query(retVal.query()); if (m_suggestionsMethod != QLatin1String("post")) { Parameters::const_iterator end = m_suggestionsParameters.constEnd(); Parameters::const_iterator i = m_suggestionsParameters.constBegin(); for (; i != end; ++i) - retVal.addQueryItem(i->first, parseTemplate(searchTerm, i->second)); + query.addQueryItem(i->first, parseTemplate(searchTerm, i->second)); } + retVal.setQuery(query); return retVal; } diff --git a/src/opensearch/opensearchenginemodel.cpp b/src/opensearch/opensearchenginemodel.cpp index a35f1bba..85559b15 100644 --- a/src/opensearch/opensearchenginemodel.cpp +++ b/src/opensearch/opensearchenginemodel.cpp @@ -172,6 +172,9 @@ QVariant OpenSearchEngineModel::headerData(int section, Qt::Orientation orientat void OpenSearchEngineModel::enginesChanged() { - QAbstractTableModel::reset(); + // TODO: fix to call beginResetModel() when appropriate + beginResetModel(); + + endResetModel(); } diff --git a/src/opensearch/opensearchmanager.cpp b/src/opensearch/opensearchmanager.cpp index d9bb0a28..2755b111 100644 --- a/src/opensearch/opensearchmanager.cpp +++ b/src/opensearch/opensearchmanager.cpp @@ -297,7 +297,7 @@ void OpenSearchManager::restoreDefaults() QString OpenSearchManager::enginesDirectory() const { - QDir directory(QDesktopServices::storageLocation(QDesktopServices::DataLocation)); + QDir directory(QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + "/data/Arora"); return directory.filePath(QLatin1String("searchengines")); } diff --git a/src/qwebplugins/clicktoflash/clicktoflash.pri b/src/qwebplugins/clicktoflash/clicktoflash.pri index 2033e59b..9e0f9393 100644 --- a/src/qwebplugins/clicktoflash/clicktoflash.pri +++ b/src/qwebplugins/clicktoflash/clicktoflash.pri @@ -1,5 +1,6 @@ INCLUDEPATH += $$PWD DEPENDPATH += $$PWD +VPATH += $$PWD HEADERS += \ clicktoflash.h \ @@ -12,4 +13,3 @@ SOURCES += \ FORMS += clicktoflash.ui clicktoflashsettings.ui RESOURCES += clicktoflash.qrc - diff --git a/src/qwebplugins/qwebplugins.pri b/src/qwebplugins/qwebplugins.pri index d3d9cb72..71281033 100644 --- a/src/qwebplugins/qwebplugins.pri +++ b/src/qwebplugins/qwebplugins.pri @@ -1,5 +1,6 @@ INCLUDEPATH += $$PWD DEPENDPATH += $$PWD +VPATH += $$PWD HEADERS += \ arorawebplugin.h \ @@ -10,4 +11,3 @@ SOURCES += \ webpluginfactory.cpp include(clicktoflash/clicktoflash.pri) - diff --git a/src/settings.cpp b/src/settings.cpp index 3cbe7e86..428f84a4 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -123,7 +123,7 @@ void SettingsDialog::loadDefaults() m_fixedFont = QFont(fixedFontFamily, fixedFontSize); fixedLabel->setText(QString(QLatin1String("%1 %2")).arg(m_fixedFont.family()).arg(m_fixedFont.pointSize())); - downloadsLocation->setText(QDesktopServices::storageLocation(QDesktopServices::DesktopLocation)); + downloadsLocation->setText(QStandardPaths::writableLocation(QStandardPaths::DesktopLocation)); blockPopupWindows->setChecked(!defaultSettings->testAttribute(QWebSettings::JavascriptCanOpenWindows)); enableJavascript->setChecked(defaultSettings->testAttribute(QWebSettings::JavascriptEnabled)); @@ -185,8 +185,8 @@ void SettingsDialog::loadFromSettings() // Appearance settings.beginGroup(QLatin1String("websettings")); - m_fixedFont = qVariantValue(settings.value(QLatin1String("fixedFont"), m_fixedFont)); - m_standardFont = qVariantValue(settings.value(QLatin1String("standardFont"), m_standardFont)); + m_fixedFont = settings.value(QLatin1String("fixedFont"), m_fixedFont).value(); + m_standardFont = settings.value(QLatin1String("standardFont"), m_standardFont).value(); standardLabel->setText(QString(QLatin1String("%1 %2")).arg(m_standardFont.family()).arg(m_standardFont.pointSize())); fixedLabel->setText(QString(QLatin1String("%1 %2")).arg(m_fixedFont.family()).arg(m_fixedFont.pointSize())); diff --git a/src/src.pri b/src/src.pri index 7c1a0e34..80a2d2b1 100644 --- a/src/src.pri +++ b/src/src.pri @@ -7,7 +7,7 @@ win32|os2 : Debug : CONFIG += console INCLUDEPATH += $$PWD DEPENDPATH += $$PWD -QT += webkit network +QT += webkit network webkitwidgets printsupport uitools # Share object files for faster compiling RCC_DIR = $$PWD/.rcc @@ -24,6 +24,8 @@ exists(../.git/HEAD) { } } +VPATH += $$PWD + FORMS += \ aboutdialog.ui \ autofilldialog.ui \ @@ -122,7 +124,7 @@ os2 { mac { ICON = browser.icns - QMAKE_INFO_PLIST = Info_mac.plist + QMAKE_INFO_PLIST = $$PWD/Info_mac.plist } include(../webkittrunk.pri) diff --git a/src/src.pro b/src/src.pro index dab73ffb..0ea6eda6 100644 --- a/src/src.pro +++ b/src/src.pro @@ -3,12 +3,10 @@ TEMPLATE = app TARGET = arora mac { TARGET = Arora - QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.4 + QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.10 } DEFINES += \ - QT_NO_CAST_FROM_ASCII \ - QT_NO_CAST_TO_ASCII \ QT_STRICT_ITERATORS \ include(../install.pri) diff --git a/src/tabbar.cpp b/src/tabbar.cpp index b684be1a..87bd54ec 100644 --- a/src/tabbar.cpp +++ b/src/tabbar.cpp @@ -71,6 +71,8 @@ #include #include #include +#include +#include #include diff --git a/src/tabwidget.cpp b/src/tabwidget.cpp index 7e5b0bf8..060f5138 100644 --- a/src/tabwidget.cpp +++ b/src/tabwidget.cpp @@ -389,7 +389,7 @@ WebView *TabWidget::makeNewTab(bool makeCurrent) m_locationBars->setSizePolicy(locationBar->sizePolicy()); #ifndef AUTOTESTS - QWidget::setTabOrder(locationBar, qFindChild(BrowserMainWindow::parentWindow(this))); + QWidget::setTabOrder(locationBar, BrowserMainWindow::parentWindow(this)->findChild()); #endif // webview diff --git a/src/tabwidget.h b/src/tabwidget.h index 6ceff10d..f155ca30 100644 --- a/src/tabwidget.h +++ b/src/tabwidget.h @@ -65,7 +65,7 @@ #include -#include +#include #include QT_BEGIN_NAMESPACE @@ -212,4 +212,3 @@ private slots: }; #endif // TABWIDGET_H - diff --git a/src/useragent/useragent.pri b/src/useragent/useragent.pri index 78f1c485..01eb3d92 100644 --- a/src/useragent/useragent.pri +++ b/src/useragent/useragent.pri @@ -1,5 +1,6 @@ INCLUDEPATH += $$PWD DEPENDPATH += $$PWD +VPATH += $$PWD HEADERS += \ useragentmenu.h diff --git a/src/utils/explorerstyle.cpp b/src/utils/explorerstyle.cpp index 4eafd5b5..89c2da2a 100644 --- a/src/utils/explorerstyle.cpp +++ b/src/utils/explorerstyle.cpp @@ -37,6 +37,8 @@ #include "explorerstyle.h" +#ifdef Q_OS_WIN + #include #include #include @@ -62,6 +64,8 @@ static PtrOpenThemeData pOpenThemeData = 0; static PtrIsAppThemed pIsAppThemed = 0; static bool vista = false; +#endif + bool isAppThemed() { #ifdef Q_OS_WIN @@ -71,6 +75,8 @@ bool isAppThemed() #endif } +#ifdef Q_OS_WIN + ExplorerStyle::ExplorerStyle() : QWindowsVistaStyle() { @@ -349,3 +355,6 @@ QPixmap ExplorerStyle::standardPixmap(StandardPixmap standardPixmap, const QStyl else return QWindowsXPStyle::standardPixmap(standardPixmap, opt, widget); } + +#endif + diff --git a/src/utils/explorerstyle.h b/src/utils/explorerstyle.h index 840bcd2d..b0f8cdc6 100644 --- a/src/utils/explorerstyle.h +++ b/src/utils/explorerstyle.h @@ -38,6 +38,8 @@ #ifndef EXPLORERSTYLE_H #define EXPLORERSTYLE_H +#ifdef Q_OS_WIN + #include class ExplorerStyle : public QWindowsVistaStyle @@ -71,5 +73,6 @@ class ExplorerStyle : public QWindowsVistaStyle mutable QRect m_currentTopRect; //current toolbar top area size mutable QRect m_currentBottomRect; //current toolbar top area size }; +#endif #endif //EXPLORERSTYLE_H diff --git a/src/utils/networkaccessmanagerproxy.h b/src/utils/networkaccessmanagerproxy.h index 53fa1eb8..e9e84689 100644 --- a/src/utils/networkaccessmanagerproxy.h +++ b/src/utils/networkaccessmanagerproxy.h @@ -29,7 +29,7 @@ #ifndef NETWORKACCESSMANAGERPROXY_H #define NETWORKACCESSMANAGERPROXY_H -#include +#include class WebPageProxy; class NetworkAccessManagerProxy : public QNetworkAccessManager diff --git a/src/utils/networkaccessmanagerproxy_p.h b/src/utils/networkaccessmanagerproxy_p.h index 37790191..1a5f0645 100644 --- a/src/utils/networkaccessmanagerproxy_p.h +++ b/src/utils/networkaccessmanagerproxy_p.h @@ -29,7 +29,8 @@ #ifndef NETWORKACCESSMANAGERPROXY_P_H #define NETWORKACCESSMANAGERPROXY_P_H -#include +#include +#include #include "networkaccessmanagerproxy.h" diff --git a/src/utils/utils.pri b/src/utils/utils.pri index fb10c559..d2e54f26 100644 --- a/src/utils/utils.pri +++ b/src/utils/utils.pri @@ -1,5 +1,6 @@ INCLUDEPATH += $$PWD DEPENDPATH += $$PWD +VPATH += $$PWD HEADERS += \ editlistview.h \ @@ -32,4 +33,3 @@ win32 { SOURCES += explorerstyle.cpp LIBS += -lgdi32 } - diff --git a/src/utils/webpageproxy.h b/src/utils/webpageproxy.h index 572b411c..72420632 100644 --- a/src/utils/webpageproxy.h +++ b/src/utils/webpageproxy.h @@ -30,7 +30,8 @@ #define WEBPAGEPROXY_H #include -#include +#include +#include class WebPageProxy : public QWebPage { @@ -46,4 +47,3 @@ class WebPageProxy : public QWebPage }; #endif // WEBPAGEPROXY_H - diff --git a/src/webactionmapper.h b/src/webactionmapper.h index 75b050cb..07b56aa8 100644 --- a/src/webactionmapper.h +++ b/src/webactionmapper.h @@ -63,7 +63,7 @@ #ifndef WEBACTIONMAPPER_H #define WEBACTIONMAPPER_H -#include +#include QT_BEGIN_NAMESPACE class QAction; @@ -99,4 +99,3 @@ private slots: }; #endif // WEBACTIONMAPPER_H - diff --git a/src/webpage.cpp b/src/webpage.cpp index 42daf7a2..166c3104 100644 --- a/src/webpage.cpp +++ b/src/webpage.cpp @@ -38,6 +38,7 @@ #include #include #include +#include #if QT_VERSION >= 0x040600 || defined(WEBKIT_TRUNK) #include diff --git a/src/webview.cpp b/src/webview.cpp index 43eeeb91..5aae9739 100644 --- a/src/webview.cpp +++ b/src/webview.cpp @@ -87,17 +87,15 @@ #include #if QT_VERSION >= 0x040600 || defined(WEBKIT_TRUNK) -#if !defined(QTWEBKIT_VERSION) || QTWEBKIT_VERSION < 0x020000 -Q_DECLARE_METATYPE(QWebElement) -#endif #include #include #include #include #include #include -#include #endif +#include +#include #include @@ -115,9 +113,10 @@ WebView::WebView(QWidget *parent) #if QT_VERSION >= 0x040600 QPalette p; if (p.color(QPalette::Window) != Qt::white) { +/* TODO: Qt 5 port? QWindowsStyle s; p = s.standardPalette(); - setPalette(p); + setPalette(p);*/ } #endif connect(page(), SIGNAL(statusBarMessage(const QString&)), @@ -445,6 +444,8 @@ void WebView::addSearchEngine() QUrl searchUrl(page()->mainFrame()->baseUrl().resolved(QUrl(formElement.attribute(QLatin1String("action"))))); QMap searchEngines; QWebElementCollection inputFields = formElement.findAll(QLatin1String("input")); + QUrlQuery query(searchUrl.query()); + foreach (QWebElement inputField, inputFields) { QString type = inputField.attribute(QLatin1String("type"), QLatin1String("text")); QString name = inputField.attribute(QLatin1String("name")); @@ -456,13 +457,13 @@ void WebView::addSearchEngine() if (inputField == element) value = QLatin1String("{searchTerms}"); - searchUrl.addQueryItem(name, value); + query.addQueryItem(name, value); } else if (type == QLatin1String("checkbox") || type == QLatin1String("radio")) { if (inputField.evaluateJavaScript(QLatin1String("this.checked")).toBool()) { - searchUrl.addQueryItem(name, value); + query.addQueryItem(name, value); } } else if (type == QLatin1String("hidden")) { - searchUrl.addQueryItem(name, value); + query.addQueryItem(name, value); } } @@ -475,7 +476,7 @@ void WebView::addSearchEngine() QWebElementCollection options = selectField.findAll(QLatin1String("option")); QString value = options.at(selectedIndex).toPlainText(); - searchUrl.addQueryItem(name, value); + query.addQueryItem(name, value); } bool ok = true; @@ -486,8 +487,9 @@ void WebView::addSearchEngine() if (!ok) return; if (!searchEngines[searchEngine].isEmpty()) - searchUrl.addQueryItem(searchEngines[searchEngine], searchEngine); + query.addQueryItem(searchEngines[searchEngine], searchEngine); } + searchUrl.setQuery(query); QString engineName; QWebElementCollection labels = formElement.findAll(QString(QLatin1String("label[for=\"%1\"]")).arg(elementName)); @@ -580,7 +582,7 @@ void WebView::loadFinished() void WebView::loadUrl(const QUrl &url, const QString &title) { if (url.scheme() == QLatin1String("javascript")) { - QString scriptSource = QUrl::fromPercentEncoding(url.toString(Q_FLAGS(QUrl::TolerantMode|QUrl::RemoveScheme)).toAscii()); + QString scriptSource = QUrl::fromPercentEncoding(url.toString(Q_FLAGS(QUrl::TolerantMode|QUrl::RemoveScheme)).toLatin1()); QVariant result = page()->mainFrame()->evaluateJavaScript(scriptSource); return; } diff --git a/tools/.qmake.conf b/tools/.qmake.conf new file mode 100644 index 00000000..7c1d952d --- /dev/null +++ b/tools/.qmake.conf @@ -0,0 +1,2 @@ +QMAKEPATH += /usr/local/opt/qtwebkit +QMAKE_MAC_SDK = macosx10.13 diff --git a/tools/cacheinfo/main.cpp b/tools/cacheinfo/main.cpp index 5e88ebc4..a46901ea 100644 --- a/tools/cacheinfo/main.cpp +++ b/tools/cacheinfo/main.cpp @@ -44,8 +44,7 @@ int main(int argc, char **argv) } NetworkDiskCache diskCache; - QString location = QDesktopServices::storageLocation(QDesktopServices::CacheLocation) - + QLatin1String("/browser/"); + QString location = QStandardPaths::writableLocation(QStandardPaths::CacheLocation) + QLatin1String("/browser/"); diskCache.setCacheDirectory(location); QNetworkCacheMetaData metaData; @@ -110,4 +109,3 @@ int main(int argc, char **argv) delete device; return 0; } - diff --git a/tools/htmlToXBel/htmlToXBel.pro b/tools/htmlToXBel/htmlToXBel.pro index a8cbef95..8fc2fb3c 100644 --- a/tools/htmlToXBel/htmlToXBel.pro +++ b/tools/htmlToXBel/htmlToXBel.pro @@ -6,7 +6,7 @@ INCLUDEPATH += . win32|os2: CONFIG += console mac:CONFIG -= app_bundle -QT += network webkit +QT += network webkit webkitwidgets # Input SOURCES += main.cpp diff --git a/tools/htmlToXBel/main.cpp b/tools/htmlToXBel/main.cpp index 15c2ea58..47b3b7d3 100644 --- a/tools/htmlToXBel/main.cpp +++ b/tools/htmlToXBel/main.cpp @@ -17,8 +17,8 @@ * Boston, MA 02110-1301 USA */ -#include -#include +#include +#include /*! A tool to convert html bookmark files into the xbel format. diff --git a/tools/placesimport/main_placesimport.cpp b/tools/placesimport/main_placesimport.cpp index ecca9adb..f2fdfd7c 100644 --- a/tools/placesimport/main_placesimport.cpp +++ b/tools/placesimport/main_placesimport.cpp @@ -22,7 +22,7 @@ #include #include #include -#include +#include #include #include #include