diff --git a/src/lib/app/mainapplication.cpp b/src/lib/app/mainapplication.cpp index 975069c75..c20c10451 100644 --- a/src/lib/app/mainapplication.cpp +++ b/src/lib/app/mainapplication.cpp @@ -128,7 +128,7 @@ MainApplication::MainApplication(const QList &cm setOverrideCursor(Qt::WaitCursor); setWindowIcon(QIcon(":icons/exeicons/qupzilla-window.png")); bool noAddons = false; - QUrl startUrl(""); + QUrl startUrl; QStringList messages; QString startProfile; @@ -178,9 +178,6 @@ MainApplication::MainApplication(const QList &cm return; } - connect(this, SIGNAL(messageReceived(QString)), this, SLOT(receiveAppMessage(QString))); - connect(this, SIGNAL(aboutToQuit()), this, SLOT(saveSettings())); - #ifdef Q_WS_MAC setQuitOnLastWindowClosed(false); #else @@ -222,34 +219,27 @@ MainApplication::MainApplication(const QList &cm settings2.setValue("isRunning", true); settings2.endGroup(); - QSettings::setPath(QSettings::IniFormat, QSettings::UserScope, m_activeProfil); - translateApp(); - QWebHistoryInterface::setDefaultInterface(new WebHistoryInterface(this)); QupZilla* qupzilla = new QupZilla(Qz::BW_FirstAppWindow, startUrl); - m_mainWindows.append(qupzilla); - connect(qupzilla, SIGNAL(message(Qz::AppMessageType, bool)), this, SLOT(sendMessages(Qz::AppMessageType, bool))); qupzilla->show(); + m_mainWindows.append(qupzilla); - AutoSaver* saver = new AutoSaver(); - connect(saver, SIGNAL(saveApp()), this, SLOT(saveStateSlot())); + connect(qupzilla, SIGNAL(message(Qz::AppMessageType, bool)), this, SLOT(sendMessages(Qz::AppMessageType, bool))); + connect(qupzilla, SIGNAL(startingCompleted()), this, SLOT(restoreCursor())); if (settings2.value("Web-Browser-Settings/CheckUpdates", DEFAULT_CHECK_UPDATES).toBool()) { m_updater = new Updater(qupzilla); } - if (noAddons) { - settings2.setValue("Plugin-Settings/AllowedPlugins", QStringList()); - settings2.setValue("Plugin-Settings/EnablePlugins", false); + loadSettings(); + networkManager()->loadCertificates(); + + if (!noAddons) { + plugins()->loadPlugins(); } - networkManager()->loadCertificates(); - plugins()->loadPlugins(); - loadSettings(); - QTimer::singleShot(0, this, SLOT(postLaunch())); - QTimer::singleShot(2000, this, SLOT(restoreCursor())); #ifdef Q_WS_WIN QTimer::singleShot(10 * 1000, this, SLOT(setupJumpList())); #endif @@ -268,6 +258,15 @@ void MainApplication::postLaunch() if (m_postLaunchActions.contains(OpenNewTab)) { getWindow()->tabWidget()->addView(QUrl(), Qz::NT_SelectedTabAtTheEnd); } + + AutoSaver* saver = new AutoSaver(); + connect(saver, SIGNAL(saveApp()), this, SLOT(saveStateSlot())); + + QSettings::setPath(QSettings::IniFormat, QSettings::UserScope, m_activeProfil); + QWebHistoryInterface::setDefaultInterface(new WebHistoryInterface(this)); + + connect(this, SIGNAL(messageReceived(QString)), this, SLOT(receiveAppMessage(QString))); + connect(this, SIGNAL(aboutToQuit()), this, SLOT(saveSettings())); } void MainApplication::loadSettings() diff --git a/src/lib/app/qupzilla.cpp b/src/lib/app/qupzilla.cpp index 537dd9125..30a6b954b 100644 --- a/src/lib/app/qupzilla.cpp +++ b/src/lib/app/qupzilla.cpp @@ -105,7 +105,6 @@ QupZilla::QupZilla(Qz::BrowserWindow type, QUrl startUrl) setObjectName("mainwindow"); setAttribute(Qt::WA_DeleteOnClose); setWindowTitle(tr("QupZilla")); - setUpdatesEnabled(false); m_activeProfil = mApp->getActiveProfilPath(); m_activeLanguage = mApp->getActiveLanguage(); @@ -188,10 +187,8 @@ void QupZilla::postLaunch() } aboutToHideEditMenu(); - setUpdatesEnabled(true); mApp->plugins()->emitMainWindowCreated(this); - emit startingCompleted(); } diff --git a/src/lib/app/qupzilla.h b/src/lib/app/qupzilla.h index afb60eb65..3e104892e 100644 --- a/src/lib/app/qupzilla.h +++ b/src/lib/app/qupzilla.h @@ -100,7 +100,6 @@ public: inline QUrl homepageUrl() { return m_homepage; } signals: - void loadHistory(); void startingCompleted(); void message(Qz::AppMessageType mes, bool state); void setWebViewMouseTracking(bool state); diff --git a/src/lib/plugins/plugins.cpp b/src/lib/plugins/plugins.cpp index b65504d4b..66b3a1826 100644 --- a/src/lib/plugins/plugins.cpp +++ b/src/lib/plugins/plugins.cpp @@ -139,7 +139,7 @@ void Plugins::loadPlugins() refreshLoadedPlugins(); - std::cout << "QupZilla: " << m_loadedPlugins.count() << " plugins loaded" << std::endl; + std::cout << "QupZilla: " << m_loadedPlugins.count() << " extensions loaded" << std::endl; } void Plugins::loadAvailablePlugins() diff --git a/src/lib/preferences/pluginslist.cpp b/src/lib/preferences/pluginslist.cpp index 5855e8c1e..ccc2b4168 100644 --- a/src/lib/preferences/pluginslist.cpp +++ b/src/lib/preferences/pluginslist.cpp @@ -217,7 +217,7 @@ void PluginsList::itemChanged(QListWidgetItem* item) if (item->checkState() == Qt::Checked && !plugin.isLoaded()) { item->setCheckState(Qt::Unchecked); - QMessageBox::critical(this, tr("Error!"), tr("Cannot load plugin!")); + QMessageBox::critical(this, tr("Error!"), tr("Cannot load extensions")); } item->setData(Qt::UserRole + 10, qVariantFromValue(plugin)); diff --git a/src/lib/preferences/preferences.ui b/src/lib/preferences/preferences.ui index a252e1609..03ca252ec 100644 --- a/src/lib/preferences/preferences.ui +++ b/src/lib/preferences/preferences.ui @@ -166,7 +166,7 @@ - Plugins + Extensions 9 diff --git a/src/lib/webview/tabbedwebview.cpp b/src/lib/webview/tabbedwebview.cpp index 9ee61c16f..af59ebbe5 100644 --- a/src/lib/webview/tabbedwebview.cpp +++ b/src/lib/webview/tabbedwebview.cpp @@ -276,19 +276,9 @@ void TabbedWebView::linkHovered(const QString &link, const QString &title, const m_hoveredLink = link; } -// FIXME: Don't do this magic to get index of tab. -// Implement setTabIndex() and call it from TabWidget (when creating and also from -// tabMoved slot) int TabbedWebView::tabIndex() const { - int i = 0; - while (WebTab* wTab = qobject_cast(m_tabWidget->widget(i))) { - if (wTab && wTab->view() == this) { - break; - } - i++; - } - return i; + return m_tabWidget->indexOf(m_webTab); } QWidget* TabbedWebView::overlayForJsAlert() diff --git a/src/lib/webview/webpage.cpp b/src/lib/webview/webpage.cpp index ac83a166f..d89fb378e 100644 --- a/src/lib/webview/webpage.cpp +++ b/src/lib/webview/webpage.cpp @@ -227,9 +227,9 @@ void WebPage::handleUnsupportedContent(QNetworkReply* reply) if (reply->header(QNetworkRequest::ContentTypeHeader).isValid()) { QString requestUrl = reply->request().url().toString(QUrl::RemoveFragment | QUrl::RemoveQuery); if (requestUrl.endsWith(".swf")) { - QWebElement docElement = mainFrame()->documentElement(); - QWebElement object = docElement.findFirst(QString("object[src=\"%1\"]").arg(requestUrl)); - QWebElement embed = docElement.findFirst(QString("embed[src=\"%1\"]").arg(requestUrl)); + const QWebElement &docElement = mainFrame()->documentElement(); + const QWebElement &object = docElement.findFirst(QString("object[src=\"%1\"]").arg(requestUrl)); + const QWebElement &embed = docElement.findFirst(QString("embed[src=\"%1\"]").arg(requestUrl)); if (!object.isNull() || !embed.isNull()) { qDebug() << "WebPage::UnsupportedContent" << url << "Attempt to download flash object on site!"; diff --git a/src/plugins/AccessKeysNavigation/akn_handler.cpp b/src/plugins/AccessKeysNavigation/akn_handler.cpp index 6c3d45bd6..04ffd48a8 100644 --- a/src/plugins/AccessKeysNavigation/akn_handler.cpp +++ b/src/plugins/AccessKeysNavigation/akn_handler.cpp @@ -65,6 +65,7 @@ Qt::Key keyFromCode(int code) AKN_Handler::AKN_Handler(const QString &sPath, QObject* parent) : QObject(parent) , m_view(0) + , m_accessKeysVisible(false) , m_settingsPath(sPath) { loadSettings(); diff --git a/src/plugins/AccessKeysNavigation/akn_plugin.cpp b/src/plugins/AccessKeysNavigation/akn_plugin.cpp index b7deddd70..b30f857f5 100644 --- a/src/plugins/AccessKeysNavigation/akn_plugin.cpp +++ b/src/plugins/AccessKeysNavigation/akn_plugin.cpp @@ -35,7 +35,7 @@ PluginSpec AKN_Plugin::pluginSpec() spec.name = "Access Keys Navigation"; spec.info = "Access keys navigation for QupZilla"; spec.description = "Provides support for navigating in webpages by keyboard shortcuts"; - spec.version = "0.2.1"; + spec.version = "0.2.2"; spec.author = "David Rosca "; spec.icon = QPixmap(":/accesskeysnavigation/data/icon.png"); spec.hasSettings = true;