diff --git a/src/lib/3rdparty/lineedit.cpp b/src/lib/3rdparty/lineedit.cpp index b8b4384c4..2ddf43c9b 100644 --- a/src/lib/3rdparty/lineedit.cpp +++ b/src/lib/3rdparty/lineedit.cpp @@ -23,7 +23,6 @@ #include #include #include -#include SideWidget::SideWidget(QWidget* parent) : QWidget(parent) @@ -157,8 +156,8 @@ void LineEdit::setTextFormat(const LineEdit::TextFormat &format) attributes.append(QInputMethodEvent::Attribute(type, start, length, value)); } - QInputMethodEvent event(QString(), attributes); - QApplication::sendEvent(this, &event); + QInputMethodEvent ev(QString(), attributes); + event(&ev); } void LineEdit::clearTextFormat() diff --git a/src/lib/app/mainapplication.cpp b/src/lib/app/mainapplication.cpp index fe614bd42..186d87877 100644 --- a/src/lib/app/mainapplication.cpp +++ b/src/lib/app/mainapplication.cpp @@ -55,6 +55,7 @@ #include #include #include +#include #include #include #include @@ -268,11 +269,14 @@ MainApplication::MainApplication(int &argc, char** argv) MainApplication::~MainApplication() { + IconProvider::instance()->saveIconsToDatabase(); + + // Wait for all QtConcurrent jobs to finish + QThreadPool::globalInstance()->waitForDone(); + // Delete all classes that are saving data in destructor delete m_bookmarks; delete m_cookieJar; - - IconProvider::instance()->saveIconsToDatabase(); } bool MainApplication::isClosing() const diff --git a/src/lib/navigation/locationbar.cpp b/src/lib/navigation/locationbar.cpp index 77f76f1de..143d68c80 100644 --- a/src/lib/navigation/locationbar.cpp +++ b/src/lib/navigation/locationbar.cpp @@ -62,6 +62,9 @@ LocationBar::LocationBar(BrowserWindow* window) setObjectName("locationbar"); setDragEnabled(true); + // Disable Oxygen QLineEdit transitions, it breaks with setText() && home() + setProperty("_kde_no_animations", QVariant(true)); + m_bookmarkIcon = new BookmarksIcon(this); m_goIcon = new GoIcon(this); m_rssIcon = new RssIcon(this); @@ -70,7 +73,6 @@ LocationBar::LocationBar(BrowserWindow* window) DownIcon* down = new DownIcon(this); addWidget(m_siteIcon, LineEdit::LeftSide); - addWidget(m_autofillIcon, LineEdit::RightSide); addWidget(m_bookmarkIcon, LineEdit::RightSide); addWidget(m_rssIcon, LineEdit::RightSide); @@ -311,11 +313,16 @@ void LocationBar::showUrl(const QUrl &url) const QString stringUrl = convertUrlToText(url); - if (stringUrl == text()) { + if (text() == stringUrl) { + home(false); return; } - setText(stringUrl); + // Set converted url as text + setText(convertUrlToText(url)); + + // Move cursor to the start + home(false); hideGoButton(); m_bookmarkIcon->checkBookmark(url);