1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-24 12:46:35 +01:00

Merge branch 'Falkon/3.0'

This commit is contained in:
David Rosca 2018-05-14 13:32:58 +02:00
commit e01024942f
No known key found for this signature in database
GPG Key ID: EBC3FC294452C6D8
10 changed files with 101 additions and 33 deletions

View File

@ -1,3 +1,21 @@
Version 3.0.1
* released 8 May 2018
* added profile migration from QupZilla
* fix incorrectly completing form data on some sites (BUG 391327)
* fix showing incorrect state of back and forward buttons (BUG 391331)
* fix loading urls containing %20 from location bar (BUG 392445)
* fix save page action for downloading text files (BUG 391300)
* fix download manager trying to closing not restored tabs (BUG 392565)
* fix updating location bar site icon after using paste and go action (BUG 392747)
* fix various issues with QtWebEngine 5.11 (BUG 392885, 393398)
* fix speed dial sometimes loading with no pages (BUG 391875)
* fix leaving html fullscreen after closing tab (BUG 393797)
* fix saving speed dial settings when there are no configured pages
* fix restoring nested crashed sessions
* fix setting minimum height of bookmarks toolbar
* VerticalTabs: fix preserving expanded state of times inside collapsed parent (BUG 393567)
* VerticalTabs: don't force open sidebar when opening new window (BUG 393629)
Version 3.0.0 Version 3.0.0
* released 27 February 2018 * released 27 February 2018
* first Falkon release * first Falkon release

View File

@ -85,6 +85,8 @@ if (WIN32)
add_definitions(-D_WIN32_WINNT=${ver}) add_definitions(-D_WIN32_WINNT=${ver})
endif() endif()
set(HAVE_QTWEBENGINE_5_10 NOT Qt5WebEngineWidgets_VERSION VERSION_LESS 5.10.0)
# Mandatory: OpenSSL # Mandatory: OpenSSL
find_package(OpenSSL REQUIRED) find_package(OpenSSL REQUIRED)

View File

@ -9,3 +9,6 @@
/* Disable DBus support */ /* Disable DBus support */
#cmakedefine DISABLE_DBUS #cmakedefine DISABLE_DBUS
/* QtWebEngine is at least version 5.10 */
#cmakedefine01 HAVE_QTWEBENGINE_5_10

View File

@ -208,12 +208,10 @@ void ProfileManager::updateProfile(const QString &current, const QString &profil
return; return;
} }
// No change in 3.1 // No change in 3.0
if (prof < Updater::Version("3.0.99")) { if (prof < Updater::Version("3.0.99")) {
return; return;
} }
// Nothing for now
} }
void ProfileManager::copyDataToProfile() void ProfileManager::copyDataToProfile()

View File

@ -65,6 +65,7 @@ WebSearchBar::WebSearchBar(BrowserWindow* window)
m_boxSearchType = new ButtonWithMenu(this); m_boxSearchType = new ButtonWithMenu(this);
m_boxSearchType->setObjectName("websearchbar-searchprovider-combobox"); m_boxSearchType->setObjectName("websearchbar-searchprovider-combobox");
m_boxSearchType->setFocusProxy(this);
// RTL Support // RTL Support
// If we don't add 'm_boxSearchType' by following code, then we should use suitable padding-left value // If we don't add 'm_boxSearchType' by following code, then we should use suitable padding-left value
// but then, when typing RTL text the layout dynamically changed and within RTL layout direction // but then, when typing RTL text the layout dynamically changed and within RTL layout direction

View File

@ -449,6 +449,8 @@ Preferences::Preferences(BrowserWindow* window)
QListWidgetItem *item = new QListWidgetItem; QListWidgetItem *item = new QListWidgetItem;
item->setText(langName); item->setText(langName);
item->setData(Qt::UserRole, lang); item->setData(Qt::UserRole, lang);
item->setFlags(item->flags() & ~Qt::ItemIsSelectable);
item->setCheckState(Qt::Unchecked);
ui->spellcheckLanguages->addItem(item); ui->spellcheckLanguages->addItem(item);
} }
} }
@ -462,7 +464,7 @@ Preferences::Preferences(BrowserWindow* window)
QListWidgetItem *item = items.at(0); QListWidgetItem *item = items.at(0);
ui->spellcheckLanguages->takeItem(ui->spellcheckLanguages->row(item)); ui->spellcheckLanguages->takeItem(ui->spellcheckLanguages->row(item));
ui->spellcheckLanguages->insertItem(topIndex++, item); ui->spellcheckLanguages->insertItem(topIndex++, item);
ui->spellcheckLanguages->setCurrentItem(item, QItemSelectionModel::Select); item->setCheckState(Qt::Checked);
} }
if (ui->spellcheckLanguages->count() == 0) { if (ui->spellcheckLanguages->count() == 0) {
@ -978,7 +980,7 @@ void Preferences::saveSettings()
QStringList languages; QStringList languages;
for (int i = 0; i < ui->spellcheckLanguages->count(); ++i) { for (int i = 0; i < ui->spellcheckLanguages->count(); ++i) {
QListWidgetItem *item = ui->spellcheckLanguages->item(i); QListWidgetItem *item = ui->spellcheckLanguages->item(i);
if (item->isSelected()) { if (item->checkState() == Qt::Checked) {
languages.append(item->data(Qt::UserRole).toString()); languages.append(item->data(Qt::UserRole).toString());
} }
} }

View File

@ -2419,9 +2419,6 @@
<property name="dragDropMode"> <property name="dragDropMode">
<enum>QAbstractItemView::InternalMove</enum> <enum>QAbstractItemView::InternalMove</enum>
</property> </property>
<property name="selectionMode">
<enum>QAbstractItemView::MultiSelection</enum>
</property>
</widget> </widget>
</item> </item>
<item row="2" column="2"> <item row="2" column="2">

View File

@ -495,7 +495,7 @@ void WebView::copyLinkToClipboard()
void WebView::savePageAs() void WebView::savePageAs()
{ {
#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0) #if HAVE_QTWEBENGINE_5_10
page()->runJavaScript(QSL("document.contentType"), WebPage::SafeJsWorld, [this](const QVariant &res) { page()->runJavaScript(QSL("document.contentType"), WebPage::SafeJsWorld, [this](const QVariant &res) {
const QSet<QString> webPageTypes = { const QSet<QString> webPageTypes = {
QSL("text/html"), QSL("text/html"),

View File

@ -73,6 +73,31 @@ static GnomeKeyringAttributeList* createAttributes(const PasswordEntry &entry)
return attributes; return attributes;
} }
static void storeEntry(PasswordEntry &entry)
{
guint32 itemId;
GnomeKeyringAttributeList* attributes = createAttributes(entry);
QByteArray pass = entry.password.toUtf8();
QByteArray host = entry.host.toUtf8();
GnomeKeyringResult result = gnome_keyring_item_create_sync(GNOME_KEYRING_DEFAULT,
GNOME_KEYRING_ITEM_GENERIC_SECRET,
host.constData(),
attributes,
pass.constData(),
TRUE, // Update if exists
&itemId);
gnome_keyring_attribute_list_free(attributes);
if (result != GNOME_KEYRING_RESULT_OK) {
qWarning() << "GnomeKeyringPasswordBackend::addEntry Cannot add entry to keyring!";
}
entry.id = itemId;
}
GnomeKeyringPasswordBackend::GnomeKeyringPasswordBackend() GnomeKeyringPasswordBackend::GnomeKeyringPasswordBackend()
: PasswordBackend() : PasswordBackend()
, m_loaded(false) , m_loaded(false)
@ -118,27 +143,7 @@ void GnomeKeyringPasswordBackend::addEntry(const PasswordEntry &entry)
PasswordEntry stored = entry; PasswordEntry stored = entry;
stored.updated = QDateTime::currentDateTime().toTime_t(); stored.updated = QDateTime::currentDateTime().toTime_t();
guint32 itemId; storeEntry(stored);
GnomeKeyringAttributeList* attributes = createAttributes(stored);
QByteArray pass = stored.password.toUtf8();
QByteArray host = stored.host.toUtf8();
GnomeKeyringResult result = gnome_keyring_item_create_sync(GNOME_KEYRING_DEFAULT,
GNOME_KEYRING_ITEM_GENERIC_SECRET,
host.constData(),
attributes,
pass.constData(),
TRUE, // Update if exists
&itemId);
gnome_keyring_attribute_list_free(attributes);
if (result != GNOME_KEYRING_RESULT_OK) {
qWarning() << "GnomeKeyringPasswordBackend::addEntry Cannot add entry to keyring!";
}
stored.id = itemId;
m_allEntries.append(stored); m_allEntries.append(stored);
} }
@ -263,6 +268,22 @@ void GnomeKeyringPasswordBackend::initialize()
return; return;
} }
bool migrate = false;
if (result == GNOME_KEYRING_RESULT_NO_MATCH) {
result = gnome_keyring_find_itemsv_sync(GNOME_KEYRING_ITEM_GENERIC_SECRET, &found,
"application", GNOME_KEYRING_ATTRIBUTE_TYPE_STRING, "QupZilla",
NULL);
if (result != GNOME_KEYRING_RESULT_OK && result != GNOME_KEYRING_RESULT_NO_MATCH) {
qWarning() << "GnomeKeyringPasswordBackend::initialize Cannot read items from keyring!";
return;
}
if (result == GNOME_KEYRING_RESULT_OK) {
migrate = true;
}
}
GList* tmp = found; GList* tmp = found;
while (tmp) { while (tmp) {
@ -273,5 +294,11 @@ void GnomeKeyringPasswordBackend::initialize()
gnome_keyring_found_list_free(found); gnome_keyring_found_list_free(found);
if (migrate) {
for (PasswordEntry &entry : m_allEntries) {
storeEntry(entry);
}
}
m_loaded = true; m_loaded = true;
} }

View File

@ -164,14 +164,23 @@ void KWalletPasswordBackend::initialize()
return; return;
} }
bool migrate = !m_wallet->hasFolder("Falkon") && m_wallet->hasFolder("QupZilla");
if (!m_wallet->hasFolder("Falkon") && !m_wallet->createFolder("Falkon")) { if (!m_wallet->hasFolder("Falkon") && !m_wallet->createFolder("Falkon")) {
qWarning() << "KWalletPasswordBackend::initialize Cannot create folder \"Falkon\"!"; qWarning() << "KWalletPasswordBackend::initialize Cannot create folder \"Falkon\"!";
return; return;
} }
if (!m_wallet->setFolder("Falkon")) { if (migrate) {
qWarning() << "KWalletPasswordBackend::initialize Cannot set folder \"Falkon\"!"; if (!m_wallet->setFolder("QupZilla")) {
return; qWarning() << "KWalletPasswordBackend::initialize Cannot set folder \"QupZilla\"!";
return;
}
} else {
if (!m_wallet->setFolder("Falkon")) {
qWarning() << "KWalletPasswordBackend::initialize Cannot set folder \"Falkon\"!";
return;
}
} }
QMap<QString, QByteArray> entries; QMap<QString, QByteArray> entries;
@ -188,6 +197,17 @@ void KWalletPasswordBackend::initialize()
} }
++i; ++i;
} }
if (migrate) {
if (!m_wallet->setFolder("Falkon")) {
qWarning() << "KWalletPasswordBackend::initialize Cannot set folder \"Falkon\"!";
return;
}
foreach (const PasswordEntry &entry, m_allEntries) {
m_wallet->writeEntry(entry.id.toString(), encodeEntry(entry));
}
}
} }
KWalletPasswordBackend::~KWalletPasswordBackend() KWalletPasswordBackend::~KWalletPasswordBackend()