mirror of
https://invent.kde.org/network/falkon.git
synced 2024-12-19 18:26:34 +01:00
Update ECM to KF 5.240.0 version
Update code to make it compile. Signed-off-by: Juraj Oravec <jurajoravec@mailo.com>
This commit is contained in:
parent
e02a8ee664
commit
eb5b015a5d
@ -16,7 +16,7 @@ set(KF_MIN_VERSION "5.240.0")
|
|||||||
|
|
||||||
# Find ECM, with nice error handling in case of failure
|
# Find ECM, with nice error handling in case of failure
|
||||||
include(FeatureSummary)
|
include(FeatureSummary)
|
||||||
find_package(ECM 5.78.0 CONFIG)
|
find_package(ECM ${KF_MIN_VERSION} CONFIG)
|
||||||
set_package_properties(ECM PROPERTIES TYPE REQUIRED DESCRIPTION "Extra CMake Modules." URL "https://invent.kde.org/frameworks/extra-cmake-modules")
|
set_package_properties(ECM PROPERTIES TYPE REQUIRED DESCRIPTION "Extra CMake Modules." URL "https://invent.kde.org/frameworks/extra-cmake-modules")
|
||||||
feature_summary(WHAT REQUIRED_PACKAGES_NOT_FOUND FATAL_ON_MISSING_REQUIRED_PACKAGES)
|
feature_summary(WHAT REQUIRED_PACKAGES_NOT_FOUND FATAL_ON_MISSING_REQUIRED_PACKAGES)
|
||||||
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
|
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
|
||||||
|
@ -49,82 +49,82 @@ void LocationBarTest::loadActionBasicTest()
|
|||||||
{
|
{
|
||||||
LocationBar::LoadAction action;
|
LocationBar::LoadAction action;
|
||||||
|
|
||||||
action = LocationBar::loadAction("http://kde.org");
|
action = LocationBar::loadAction(QSL("http://kde.org"));
|
||||||
QCOMPARE(action.type, LocationBar::LoadAction::Url);
|
QCOMPARE(action.type, LocationBar::LoadAction::Url);
|
||||||
QCOMPARE(action.loadRequest.url(), QUrl("http://kde.org"));
|
QCOMPARE(action.loadRequest.url(), QUrl(QSL("http://kde.org")));
|
||||||
|
|
||||||
action = LocationBar::loadAction("kde.org");
|
action = LocationBar::loadAction(QSL("kde.org"));
|
||||||
QCOMPARE(action.type, LocationBar::LoadAction::Url);
|
QCOMPARE(action.type, LocationBar::LoadAction::Url);
|
||||||
QCOMPARE(action.loadRequest.url(), QUrl("http://kde.org"));
|
QCOMPARE(action.loadRequest.url(), QUrl(QSL("http://kde.org")));
|
||||||
|
|
||||||
action = LocationBar::loadAction("localhost");
|
action = LocationBar::loadAction(QSL("localhost"));
|
||||||
QCOMPARE(action.type, LocationBar::LoadAction::Url);
|
QCOMPARE(action.type, LocationBar::LoadAction::Url);
|
||||||
QCOMPARE(action.loadRequest.url(), QUrl("http://localhost"));
|
QCOMPARE(action.loadRequest.url(), QUrl(QSL("http://localhost")));
|
||||||
|
|
||||||
action = LocationBar::loadAction("localhost/test/path?x=2");
|
action = LocationBar::loadAction(QSL("localhost/test/path?x=2"));
|
||||||
QCOMPARE(action.type, LocationBar::LoadAction::Url);
|
QCOMPARE(action.type, LocationBar::LoadAction::Url);
|
||||||
QCOMPARE(action.loadRequest.url(), QUrl("http://localhost/test/path?x=2"));
|
QCOMPARE(action.loadRequest.url(), QUrl(QSL("http://localhost/test/path?x=2")));
|
||||||
|
|
||||||
action = LocationBar::loadAction("host.com/test/path?x=2");
|
action = LocationBar::loadAction(QSL("host.com/test/path?x=2"));
|
||||||
QCOMPARE(action.type, LocationBar::LoadAction::Url);
|
QCOMPARE(action.type, LocationBar::LoadAction::Url);
|
||||||
QCOMPARE(action.loadRequest.url(), QUrl("http://host.com/test/path?x=2"));
|
QCOMPARE(action.loadRequest.url(), QUrl(QSL("http://host.com/test/path?x=2")));
|
||||||
|
|
||||||
action = LocationBar::loadAction("not-url");
|
action = LocationBar::loadAction(QSL("not-url"));
|
||||||
QCOMPARE(action.type, LocationBar::LoadAction::Search);
|
QCOMPARE(action.type, LocationBar::LoadAction::Search);
|
||||||
|
|
||||||
action = LocationBar::loadAction("not url with spaces");
|
action = LocationBar::loadAction(QSL("not url with spaces"));
|
||||||
QCOMPARE(action.type, LocationBar::LoadAction::Search);
|
QCOMPARE(action.type, LocationBar::LoadAction::Search);
|
||||||
|
|
||||||
action = LocationBar::loadAction("falkon:about");
|
action = LocationBar::loadAction(QSL("falkon:about"));
|
||||||
QCOMPARE(action.type, LocationBar::LoadAction::Url);
|
QCOMPARE(action.type, LocationBar::LoadAction::Url);
|
||||||
QCOMPARE(action.loadRequest.url(), QUrl("falkon:about"));
|
QCOMPARE(action.loadRequest.url(), QUrl(QSL("falkon:about")));
|
||||||
}
|
}
|
||||||
|
|
||||||
void LocationBarTest::loadActionBookmarksTest()
|
void LocationBarTest::loadActionBookmarksTest()
|
||||||
{
|
{
|
||||||
auto* bookmark = new BookmarkItem(BookmarkItem::Url);
|
auto* bookmark = new BookmarkItem(BookmarkItem::Url);
|
||||||
bookmark->setTitle("KDE Bookmark title");
|
bookmark->setTitle(QSL("KDE Bookmark title"));
|
||||||
bookmark->setUrl(QUrl("http://kde.org"));
|
bookmark->setUrl(QUrl(QSL("http://kde.org")));
|
||||||
bookmark->setKeyword("kde-bookmark");
|
bookmark->setKeyword(QSL("kde-bookmark"));
|
||||||
mApp->bookmarks()->addBookmark(mApp->bookmarks()->unsortedFolder(), bookmark);
|
mApp->bookmarks()->addBookmark(mApp->bookmarks()->unsortedFolder(), bookmark);
|
||||||
|
|
||||||
LocationBar::LoadAction action;
|
LocationBar::LoadAction action;
|
||||||
|
|
||||||
action = LocationBar::loadAction("http://kde.org");
|
action = LocationBar::loadAction(QSL("http://kde.org"));
|
||||||
QCOMPARE(action.type, LocationBar::LoadAction::Url);
|
QCOMPARE(action.type, LocationBar::LoadAction::Url);
|
||||||
QCOMPARE(action.loadRequest.url(), QUrl("http://kde.org"));
|
QCOMPARE(action.loadRequest.url(), QUrl(QSL("http://kde.org")));
|
||||||
|
|
||||||
action = LocationBar::loadAction("kde-bookmark-notkeyword");
|
action = LocationBar::loadAction(QSL("kde-bookmark-notkeyword"));
|
||||||
QCOMPARE(action.type, LocationBar::LoadAction::Search);
|
QCOMPARE(action.type, LocationBar::LoadAction::Search);
|
||||||
|
|
||||||
action = LocationBar::loadAction("kde-bookmark");
|
action = LocationBar::loadAction(QSL("kde-bookmark"));
|
||||||
QCOMPARE(action.type, LocationBar::LoadAction::Bookmark);
|
QCOMPARE(action.type, LocationBar::LoadAction::Bookmark);
|
||||||
QCOMPARE(action.bookmark, bookmark);
|
QCOMPARE(action.bookmark, bookmark);
|
||||||
QCOMPARE(action.loadRequest.url(), QUrl("http://kde.org"));
|
QCOMPARE(action.loadRequest.url(), QUrl(QSL("http://kde.org")));
|
||||||
}
|
}
|
||||||
|
|
||||||
void LocationBarTest::loadActionSearchTest()
|
void LocationBarTest::loadActionSearchTest()
|
||||||
{
|
{
|
||||||
SearchEngine engine;
|
SearchEngine engine;
|
||||||
engine.name = "Test Engine";
|
engine.name = QSL("Test Engine");
|
||||||
engine.url = "http://test/%s";
|
engine.url = QSL("http://test/%s");
|
||||||
engine.shortcut = "t";
|
engine.shortcut = QSL("t");
|
||||||
mApp->searchEnginesManager()->addEngine(engine);
|
mApp->searchEnginesManager()->addEngine(engine);
|
||||||
mApp->searchEnginesManager()->setActiveEngine(engine);
|
mApp->searchEnginesManager()->setActiveEngine(engine);
|
||||||
|
|
||||||
LocationBar::LoadAction action;
|
LocationBar::LoadAction action;
|
||||||
|
|
||||||
action = LocationBar::loadAction("search term");
|
action = LocationBar::loadAction(QSL("search term"));
|
||||||
QCOMPARE(action.type, LocationBar::LoadAction::Search);
|
QCOMPARE(action.type, LocationBar::LoadAction::Search);
|
||||||
QCOMPARE(action.loadRequest.url(), QUrl("http://test/search%20term"));
|
QCOMPARE(action.loadRequest.url(), QUrl(QSL("http://test/search%20term")));
|
||||||
|
|
||||||
action = LocationBar::loadAction("t search term");
|
action = LocationBar::loadAction(QSL("t search term"));
|
||||||
QCOMPARE(action.type, LocationBar::LoadAction::Search);
|
QCOMPARE(action.type, LocationBar::LoadAction::Search);
|
||||||
QCOMPARE(action.loadRequest.url(), QUrl("http://test/search%20term"));
|
QCOMPARE(action.loadRequest.url(), QUrl(QSL("http://test/search%20term")));
|
||||||
|
|
||||||
action = LocationBar::loadAction(" ttt-notsearch");
|
action = LocationBar::loadAction(QSL(" ttt-notsearch"));
|
||||||
QCOMPARE(action.type, LocationBar::LoadAction::Search);
|
QCOMPARE(action.type, LocationBar::LoadAction::Search);
|
||||||
QCOMPARE(action.loadRequest.url(), QUrl("http://test/ttt-notsearch"));
|
QCOMPARE(action.loadRequest.url(), QUrl(QSL("http://test/ttt-notsearch")));
|
||||||
}
|
}
|
||||||
|
|
||||||
void LocationBarTest::loadAction_kdebug389491()
|
void LocationBarTest::loadAction_kdebug389491()
|
||||||
@ -132,54 +132,54 @@ void LocationBarTest::loadAction_kdebug389491()
|
|||||||
// "site:website.com searchterm" and "link:website.com" are loaded instead of searched
|
// "site:website.com searchterm" and "link:website.com" are loaded instead of searched
|
||||||
|
|
||||||
SearchEngine engine;
|
SearchEngine engine;
|
||||||
engine.name = "Test Engine";
|
engine.name = QSL("Test Engine");
|
||||||
engine.url = "http://test/%s";
|
engine.url = QSL("http://test/%s");
|
||||||
engine.shortcut = "t";
|
engine.shortcut = QSL("t");
|
||||||
mApp->searchEnginesManager()->addEngine(engine);
|
mApp->searchEnginesManager()->addEngine(engine);
|
||||||
mApp->searchEnginesManager()->setActiveEngine(engine);
|
mApp->searchEnginesManager()->setActiveEngine(engine);
|
||||||
|
|
||||||
LocationBar::LoadAction action;
|
LocationBar::LoadAction action;
|
||||||
|
|
||||||
action = LocationBar::loadAction("site:website.com searchterm");
|
action = LocationBar::loadAction(QSL("site:website.com searchterm"));
|
||||||
QCOMPARE(action.type, LocationBar::LoadAction::Search);
|
QCOMPARE(action.type, LocationBar::LoadAction::Search);
|
||||||
QCOMPARE(action.loadRequest.url(), QUrl("http://test/site%3Awebsite.com%20searchterm"));
|
QCOMPARE(action.loadRequest.url(), QUrl(QSL("http://test/site%3Awebsite.com%20searchterm")));
|
||||||
|
|
||||||
action = LocationBar::loadAction("link:website.com");
|
action = LocationBar::loadAction(QSL("link:website.com"));
|
||||||
QCOMPARE(action.type, LocationBar::LoadAction::Search);
|
QCOMPARE(action.type, LocationBar::LoadAction::Search);
|
||||||
QCOMPARE(action.loadRequest.url(), QUrl("http://test/link%3Awebsite.com"));
|
QCOMPARE(action.loadRequest.url(), QUrl(QSL("http://test/link%3Awebsite.com")));
|
||||||
|
|
||||||
action = LocationBar::loadAction("http://website.com?search=searchterm and another");
|
action = LocationBar::loadAction(QSL("http://website.com?search=searchterm and another"));
|
||||||
QCOMPARE(action.type, LocationBar::LoadAction::Url);
|
QCOMPARE(action.type, LocationBar::LoadAction::Url);
|
||||||
QCOMPARE(action.loadRequest.url(), QUrl("http://website.com?search=searchterm and another"));
|
QCOMPARE(action.loadRequest.url(), QUrl(QSL("http://website.com?search=searchterm and another")));
|
||||||
}
|
}
|
||||||
|
|
||||||
void LocationBarTest::loadActionSpecialSchemesTest()
|
void LocationBarTest::loadActionSpecialSchemesTest()
|
||||||
{
|
{
|
||||||
LocationBar::LoadAction action;
|
LocationBar::LoadAction action;
|
||||||
|
|
||||||
action = LocationBar::loadAction("data:image/png;base64,xxxxx");
|
action = LocationBar::loadAction(QSL("data:image/png;base64,xxxxx"));
|
||||||
QCOMPARE(action.type, LocationBar::LoadAction::Url);
|
QCOMPARE(action.type, LocationBar::LoadAction::Url);
|
||||||
QCOMPARE(action.loadRequest.url(), QUrl("data:image/png;base64,xxxxx"));
|
QCOMPARE(action.loadRequest.url(), QUrl(QSL("data:image/png;base64,xxxxx")));
|
||||||
|
|
||||||
action = LocationBar::loadAction("falkon:about");
|
action = LocationBar::loadAction(QSL("falkon:about"));
|
||||||
QCOMPARE(action.type, LocationBar::LoadAction::Url);
|
QCOMPARE(action.type, LocationBar::LoadAction::Url);
|
||||||
QCOMPARE(action.loadRequest.url(), QUrl("falkon:about"));
|
QCOMPARE(action.loadRequest.url(), QUrl(QSL("falkon:about")));
|
||||||
|
|
||||||
action = LocationBar::loadAction("file:test.html");
|
action = LocationBar::loadAction(QSL("file:test.html"));
|
||||||
QCOMPARE(action.type, LocationBar::LoadAction::Url);
|
QCOMPARE(action.type, LocationBar::LoadAction::Url);
|
||||||
QCOMPARE(action.loadRequest.url(), QUrl("file:test.html"));
|
QCOMPARE(action.loadRequest.url(), QUrl(QSL("file:test.html")));
|
||||||
|
|
||||||
action = LocationBar::loadAction("about:blank");
|
action = LocationBar::loadAction(QSL("about:blank"));
|
||||||
QCOMPARE(action.type, LocationBar::LoadAction::Url);
|
QCOMPARE(action.type, LocationBar::LoadAction::Url);
|
||||||
QCOMPARE(action.loadRequest.url(), QUrl("about:blank"));
|
QCOMPARE(action.loadRequest.url(), QUrl(QSL("about:blank")));
|
||||||
|
|
||||||
action = LocationBar::loadAction("javascript:test");
|
action = LocationBar::loadAction(QSL("javascript:test"));
|
||||||
QCOMPARE(action.type, LocationBar::LoadAction::Url);
|
QCOMPARE(action.type, LocationBar::LoadAction::Url);
|
||||||
QCOMPARE(action.loadRequest.url(), QUrl("javascript:test"));
|
QCOMPARE(action.loadRequest.url(), QUrl(QSL("javascript:test")));
|
||||||
|
|
||||||
action = LocationBar::loadAction("javascript:alert(' test ');");
|
action = LocationBar::loadAction(QSL("javascript:alert(' test ');"));
|
||||||
QCOMPARE(action.type, LocationBar::LoadAction::Url);
|
QCOMPARE(action.type, LocationBar::LoadAction::Url);
|
||||||
QCOMPARE(action.loadRequest.url(), QUrl("javascript:alert('%20test%20');"));
|
QCOMPARE(action.loadRequest.url(), QUrl(QSL("javascript:alert('%20test%20');")));
|
||||||
}
|
}
|
||||||
|
|
||||||
void LocationBarTest::loadAction_issue2578()
|
void LocationBarTest::loadAction_issue2578()
|
||||||
@ -190,27 +190,27 @@ void LocationBarTest::loadAction_issue2578()
|
|||||||
|
|
||||||
LocationBar::LoadAction action;
|
LocationBar::LoadAction action;
|
||||||
|
|
||||||
action = LocationBar::loadAction("github.com");
|
action = LocationBar::loadAction(QSL("github.com"));
|
||||||
QCOMPARE(action.type, LocationBar::LoadAction::Url);
|
QCOMPARE(action.type, LocationBar::LoadAction::Url);
|
||||||
QCOMPARE(action.loadRequest.url(), QUrl("http://github.com"));
|
QCOMPARE(action.loadRequest.url(), QUrl(QSL("http://github.com")));
|
||||||
|
|
||||||
action = LocationBar::loadAction("github");
|
action = LocationBar::loadAction(QSL("github"));
|
||||||
QCOMPARE(action.type, LocationBar::LoadAction::Url);
|
QCOMPARE(action.type, LocationBar::LoadAction::Url);
|
||||||
QCOMPARE(action.loadRequest.url(), QUrl("http://github"));
|
QCOMPARE(action.loadRequest.url(), QUrl(QSL("http://github")));
|
||||||
|
|
||||||
action = LocationBar::loadAction("github/test/path");
|
action = LocationBar::loadAction(QSL("github/test/path"));
|
||||||
QCOMPARE(action.type, LocationBar::LoadAction::Url);
|
QCOMPARE(action.type, LocationBar::LoadAction::Url);
|
||||||
QCOMPARE(action.loadRequest.url(), QUrl("http://github/test/path"));
|
QCOMPARE(action.loadRequest.url(), QUrl(QSL("http://github/test/path")));
|
||||||
|
|
||||||
action = LocationBar::loadAction("localhost");
|
action = LocationBar::loadAction(QSL("localhost"));
|
||||||
QCOMPARE(action.type, LocationBar::LoadAction::Url);
|
QCOMPARE(action.type, LocationBar::LoadAction::Url);
|
||||||
QCOMPARE(action.loadRequest.url(), QUrl("http://localhost"));
|
QCOMPARE(action.loadRequest.url(), QUrl(QSL("http://localhost")));
|
||||||
|
|
||||||
action = LocationBar::loadAction("localhost/test/path");
|
action = LocationBar::loadAction(QSL("localhost/test/path"));
|
||||||
QCOMPARE(action.type, LocationBar::LoadAction::Url);
|
QCOMPARE(action.type, LocationBar::LoadAction::Url);
|
||||||
QCOMPARE(action.loadRequest.url(), QUrl("http://localhost/test/path"));
|
QCOMPARE(action.loadRequest.url(), QUrl(QSL("http://localhost/test/path")));
|
||||||
|
|
||||||
action = LocationBar::loadAction("github.com foo bar");
|
action = LocationBar::loadAction(QSL("github.com foo bar"));
|
||||||
QCOMPARE(action.type, LocationBar::LoadAction::Invalid);
|
QCOMPARE(action.type, LocationBar::LoadAction::Invalid);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -222,9 +222,9 @@ void LocationBarTest::loadAction_kdebug392445()
|
|||||||
|
|
||||||
LocationBar::LoadAction action;
|
LocationBar::LoadAction action;
|
||||||
|
|
||||||
action = LocationBar::loadAction("http://www.example.com/my%20beautiful%20page");
|
action = LocationBar::loadAction(QSL("http://www.example.com/my%20beautiful%20page"));
|
||||||
QCOMPARE(action.type, LocationBar::LoadAction::Url);
|
QCOMPARE(action.type, LocationBar::LoadAction::Url);
|
||||||
QCOMPARE(action.loadRequest.url(), QUrl("http://www.example.com/my%20beautiful%20page"));
|
QCOMPARE(action.loadRequest.url(), QUrl(QSL("http://www.example.com/my%20beautiful%20page")));
|
||||||
}
|
}
|
||||||
|
|
||||||
FALKONTEST_MAIN(LocationBarTest)
|
FALKONTEST_MAIN(LocationBarTest)
|
||||||
|
@ -72,7 +72,7 @@ void PasswordBackendTest::cleanupTestCase()
|
|||||||
cleanup();
|
cleanup();
|
||||||
|
|
||||||
reloadBackend();
|
reloadBackend();
|
||||||
foreach (const PasswordEntry &entry, m_entries) {
|
for (const PasswordEntry &entry : std::as_const(m_entries)) {
|
||||||
m_backend->addEntry(entry);
|
m_backend->addEntry(entry);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -31,16 +31,16 @@ void QmlBookmarksApiTest::cleanupTestCase()
|
|||||||
|
|
||||||
void QmlBookmarksApiTest::testBookmarkTreeNodeType()
|
void QmlBookmarksApiTest::testBookmarkTreeNodeType()
|
||||||
{
|
{
|
||||||
auto type = BookmarkItem::Type(m_testHelper.evaluate("Falkon.Bookmarks.rootItem().type").toInt());
|
auto type = BookmarkItem::Type(m_testHelper.evaluate(QSL("Falkon.Bookmarks.rootItem().type")).toInt());
|
||||||
QCOMPARE(mApp->bookmarks()->rootItem()->type(), type);
|
QCOMPARE(mApp->bookmarks()->rootItem()->type(), type);
|
||||||
|
|
||||||
type = BookmarkItem::Type(m_testHelper.evaluate("Falkon.Bookmarks.toolbarFolder().type").toInt());
|
type = BookmarkItem::Type(m_testHelper.evaluate(QSL("Falkon.Bookmarks.toolbarFolder().type")).toInt());
|
||||||
QCOMPARE(mApp->bookmarks()->toolbarFolder()->type(), type);
|
QCOMPARE(mApp->bookmarks()->toolbarFolder()->type(), type);
|
||||||
}
|
}
|
||||||
|
|
||||||
void QmlBookmarksApiTest::testBookmarkTreeNode()
|
void QmlBookmarksApiTest::testBookmarkTreeNode()
|
||||||
{
|
{
|
||||||
QObject *bookmark = m_testHelper.evaluateQObject("Falkon.Bookmarks.toolbarFolder()");
|
QObject *bookmark = m_testHelper.evaluateQObject(QSL("Falkon.Bookmarks.toolbarFolder()"));
|
||||||
QVERIFY(bookmark);
|
QVERIFY(bookmark);
|
||||||
auto toolbarFolder = mApp->bookmarks()->toolbarFolder();
|
auto toolbarFolder = mApp->bookmarks()->toolbarFolder();
|
||||||
|
|
||||||
@ -56,11 +56,11 @@ void QmlBookmarksApiTest::testBookmarkTreeNode()
|
|||||||
void QmlBookmarksApiTest::testBookmarksCreation()
|
void QmlBookmarksApiTest::testBookmarksCreation()
|
||||||
{
|
{
|
||||||
auto item = new BookmarkItem(BookmarkItem::Url);
|
auto item = new BookmarkItem(BookmarkItem::Url);
|
||||||
item->setTitle("Example Domain");
|
item->setTitle(QSL("Example Domain"));
|
||||||
item->setUrl(QUrl("https://example.com/"));
|
item->setUrl(QUrl(QSL("https://example.com/")));
|
||||||
item->setDescription("Testing bookmark description");
|
item->setDescription(QSL("Testing bookmark description"));
|
||||||
|
|
||||||
QObject *qmlBookmarks = m_testHelper.evaluateQObject("Falkon.Bookmarks");
|
QObject *qmlBookmarks = m_testHelper.evaluateQObject(QSL("Falkon.Bookmarks"));
|
||||||
QVERIFY(qmlBookmarks);
|
QVERIFY(qmlBookmarks);
|
||||||
|
|
||||||
QSignalSpy qmlBookmarksSpy(qmlBookmarks, SIGNAL(created(QmlBookmarkTreeNode*)));
|
QSignalSpy qmlBookmarksSpy(qmlBookmarks, SIGNAL(created(QmlBookmarkTreeNode*)));
|
||||||
@ -75,87 +75,87 @@ void QmlBookmarksApiTest::testBookmarksCreation()
|
|||||||
qRegisterMetaType<BookmarkItem*>();
|
qRegisterMetaType<BookmarkItem*>();
|
||||||
QSignalSpy bookmarksSpy(mApp->bookmarks(), &Bookmarks::bookmarkAdded);
|
QSignalSpy bookmarksSpy(mApp->bookmarks(), &Bookmarks::bookmarkAdded);
|
||||||
|
|
||||||
auto out = m_testHelper.evaluate("Falkon.Bookmarks.create({"
|
auto out = m_testHelper.evaluate(QL1S("Falkon.Bookmarks.create({"
|
||||||
" parent: Falkon.Bookmarks.toolbarFolder(),"
|
" parent: Falkon.Bookmarks.toolbarFolder(),"
|
||||||
" title: 'Example Plugin',"
|
" title: 'Example Plugin',"
|
||||||
" url: 'https://another-example.com'"
|
" url: 'https://another-example.com'"
|
||||||
"});");
|
"});"));
|
||||||
QVERIFY(out.toBool());
|
QVERIFY(out.toBool());
|
||||||
|
|
||||||
QCOMPARE(bookmarksSpy.count(), 1);
|
QCOMPARE(bookmarksSpy.count(), 1);
|
||||||
auto* createdItem = qvariant_cast<BookmarkItem*>(bookmarksSpy.at(0).at(0));
|
auto* createdItem = qvariant_cast<BookmarkItem*>(bookmarksSpy.at(0).at(0));
|
||||||
QVERIFY(createdItem);
|
QVERIFY(createdItem);
|
||||||
QCOMPARE(createdItem->title(), QString("Example Plugin"));
|
QCOMPARE(createdItem->title(), QSL("Example Plugin"));
|
||||||
}
|
}
|
||||||
|
|
||||||
void QmlBookmarksApiTest::testBookmarksExistence()
|
void QmlBookmarksApiTest::testBookmarksExistence()
|
||||||
{
|
{
|
||||||
// in continuation from testBookmarksCreation
|
// in continuation from testBookmarksCreation
|
||||||
|
|
||||||
auto result = m_testHelper.evaluate("Falkon.Bookmarks.isBookmarked('https://example.com/')").toBool();
|
auto result = m_testHelper.evaluate(QSL("Falkon.Bookmarks.isBookmarked('https://example.com/')")).toBool();
|
||||||
QVERIFY(result);
|
QVERIFY(result);
|
||||||
QCOMPARE(mApp->bookmarks()->isBookmarked(QUrl("https://example.com/")), result);
|
QCOMPARE(mApp->bookmarks()->isBookmarked(QUrl(QSL("https://example.com/"))), result);
|
||||||
}
|
}
|
||||||
|
|
||||||
void QmlBookmarksApiTest::testBookmarksModification()
|
void QmlBookmarksApiTest::testBookmarksModification()
|
||||||
{
|
{
|
||||||
// in continuation from testBookmarksExistence
|
// in continuation from testBookmarksExistence
|
||||||
|
|
||||||
QObject *qmlBookmarks = m_testHelper.evaluateQObject("Falkon.Bookmarks");
|
QObject *qmlBookmarks = m_testHelper.evaluateQObject(QSL("Falkon.Bookmarks"));
|
||||||
QVERIFY(qmlBookmarks);
|
QVERIFY(qmlBookmarks);
|
||||||
|
|
||||||
QSignalSpy qmlBookmarksSpy(qmlBookmarks, SIGNAL(changed(QmlBookmarkTreeNode*)));
|
QSignalSpy qmlBookmarksSpy(qmlBookmarks, SIGNAL(changed(QmlBookmarkTreeNode*)));
|
||||||
BookmarkItem* item = mApp->bookmarks()->searchBookmarks("https://example.com/").at(0);
|
BookmarkItem* item = mApp->bookmarks()->searchBookmarks(QSL("https://example.com/")).at(0);
|
||||||
item->setTitle("Modified Example Domain");
|
item->setTitle(QSL("Modified Example Domain"));
|
||||||
mApp->bookmarks()->changeBookmark(item);
|
mApp->bookmarks()->changeBookmark(item);
|
||||||
|
|
||||||
QCOMPARE(qmlBookmarksSpy.count(), 1);
|
QCOMPARE(qmlBookmarksSpy.count(), 1);
|
||||||
|
|
||||||
auto *modified = qvariant_cast<QObject*>(qmlBookmarksSpy.at(0).at(0));
|
auto *modified = qvariant_cast<QObject*>(qmlBookmarksSpy.at(0).at(0));
|
||||||
QVERIFY(modified);
|
QVERIFY(modified);
|
||||||
QCOMPARE(modified->property("title").toString(), QString("Modified Example Domain"));
|
QCOMPARE(modified->property("title").toString(), QSL("Modified Example Domain"));
|
||||||
|
|
||||||
qRegisterMetaType<BookmarkItem*>();
|
qRegisterMetaType<BookmarkItem*>();
|
||||||
QSignalSpy bookmarksSpy(mApp->bookmarks(), &Bookmarks::bookmarkChanged);
|
QSignalSpy bookmarksSpy(mApp->bookmarks(), &Bookmarks::bookmarkChanged);
|
||||||
|
|
||||||
auto out = m_testHelper.evaluate("Falkon.Bookmarks.update(Falkon.Bookmarks.get('https://another-example.com'),{"
|
auto out = m_testHelper.evaluate(QL1S("Falkon.Bookmarks.update(Falkon.Bookmarks.get('https://another-example.com'),{"
|
||||||
" title: 'Modified Example Plugin'"
|
" title: 'Modified Example Plugin'"
|
||||||
"})");
|
"})"));
|
||||||
QVERIFY(out.toBool());
|
QVERIFY(out.toBool());
|
||||||
|
|
||||||
QCOMPARE(bookmarksSpy.count(), 1);
|
QCOMPARE(bookmarksSpy.count(), 1);
|
||||||
auto* modifiedItem = qvariant_cast<BookmarkItem*>(bookmarksSpy.at(0).at(0));
|
auto* modifiedItem = qvariant_cast<BookmarkItem*>(bookmarksSpy.at(0).at(0));
|
||||||
QVERIFY(modifiedItem);
|
QVERIFY(modifiedItem);
|
||||||
QCOMPARE(modifiedItem->title(), QString("Modified Example Plugin"));
|
QCOMPARE(modifiedItem->title(), QSL("Modified Example Plugin"));
|
||||||
}
|
}
|
||||||
|
|
||||||
void QmlBookmarksApiTest::testBookmarksRemoval()
|
void QmlBookmarksApiTest::testBookmarksRemoval()
|
||||||
{
|
{
|
||||||
// in continuation from testBookmarksModification
|
// in continuation from testBookmarksModification
|
||||||
|
|
||||||
QObject *qmlBookmarks = m_testHelper.evaluateQObject("Falkon.Bookmarks");
|
QObject *qmlBookmarks = m_testHelper.evaluateQObject(QSL("Falkon.Bookmarks"));
|
||||||
QVERIFY(qmlBookmarks);
|
QVERIFY(qmlBookmarks);
|
||||||
|
|
||||||
QSignalSpy qmlBookmarksSpy(qmlBookmarks, SIGNAL(removed(QmlBookmarkTreeNode*)));
|
QSignalSpy qmlBookmarksSpy(qmlBookmarks, SIGNAL(removed(QmlBookmarkTreeNode*)));
|
||||||
BookmarkItem* item = mApp->bookmarks()->searchBookmarks("https://example.com/").at(0);
|
BookmarkItem* item = mApp->bookmarks()->searchBookmarks(QSL("https://example.com/")).at(0);
|
||||||
mApp->bookmarks()->removeBookmark(item);
|
mApp->bookmarks()->removeBookmark(item);
|
||||||
|
|
||||||
QCOMPARE(qmlBookmarksSpy.count(), 1);
|
QCOMPARE(qmlBookmarksSpy.count(), 1);
|
||||||
|
|
||||||
auto *removed = qvariant_cast<QObject*>(qmlBookmarksSpy.at(0).at(0));
|
auto *removed = qvariant_cast<QObject*>(qmlBookmarksSpy.at(0).at(0));
|
||||||
QVERIFY(removed);
|
QVERIFY(removed);
|
||||||
QCOMPARE(removed->property("title").toString(), QString("Modified Example Domain"));
|
QCOMPARE(removed->property("title").toString(), QSL("Modified Example Domain"));
|
||||||
|
|
||||||
qRegisterMetaType<BookmarkItem*>();
|
qRegisterMetaType<BookmarkItem*>();
|
||||||
QSignalSpy bookmarksSpy(mApp->bookmarks(), &Bookmarks::bookmarkRemoved);
|
QSignalSpy bookmarksSpy(mApp->bookmarks(), &Bookmarks::bookmarkRemoved);
|
||||||
|
|
||||||
auto out = m_testHelper.evaluate("Falkon.Bookmarks.remove(Falkon.Bookmarks.get('https://another-example.com'))");
|
auto out = m_testHelper.evaluate(QSL("Falkon.Bookmarks.remove(Falkon.Bookmarks.get('https://another-example.com'))"));
|
||||||
QVERIFY(out.toBool());
|
QVERIFY(out.toBool());
|
||||||
|
|
||||||
QCOMPARE(bookmarksSpy.count(), 1);
|
QCOMPARE(bookmarksSpy.count(), 1);
|
||||||
auto* removedItem = qvariant_cast<BookmarkItem*>(bookmarksSpy.at(0).at(0));
|
auto* removedItem = qvariant_cast<BookmarkItem*>(bookmarksSpy.at(0).at(0));
|
||||||
QVERIFY(removedItem);
|
QVERIFY(removedItem);
|
||||||
QCOMPARE(removedItem->title(), QString("Modified Example Plugin"));
|
QCOMPARE(removedItem->title(), QSL("Modified Example Plugin"));
|
||||||
}
|
}
|
||||||
|
|
||||||
FALKONTEST_MAIN(QmlBookmarksApiTest)
|
FALKONTEST_MAIN(QmlBookmarksApiTest)
|
||||||
|
@ -30,7 +30,7 @@ void QmlClipboardApiTest::cleanupTestCase()
|
|||||||
|
|
||||||
void QmlClipboardApiTest::testClipboard()
|
void QmlClipboardApiTest::testClipboard()
|
||||||
{
|
{
|
||||||
m_testHelper.evaluate("Falkon.Clipboard.copy('this text is copied')");
|
m_testHelper.evaluate(QSL("Falkon.Clipboard.copy('this text is copied')"));
|
||||||
QCOMPARE(mApp->clipboard()->text(), QSL("this text is copied"));
|
QCOMPARE(mApp->clipboard()->text(), QSL("this text is copied"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -33,42 +33,42 @@ void QmlCookiesApiTest::cleanupTestCase()
|
|||||||
void QmlCookiesApiTest::testCookieAdditionRemoval()
|
void QmlCookiesApiTest::testCookieAdditionRemoval()
|
||||||
{
|
{
|
||||||
QSignalSpy cookieAddSpy(mApp->cookieJar(), &CookieJar::cookieAdded);
|
QSignalSpy cookieAddSpy(mApp->cookieJar(), &CookieJar::cookieAdded);
|
||||||
m_testHelper.evaluate("Falkon.Cookies.set({"
|
m_testHelper.evaluate(QL1S("Falkon.Cookies.set({"
|
||||||
" name: 'Example',"
|
" name: 'Example',"
|
||||||
" url: '.example.com',"
|
" url: '.example.com',"
|
||||||
" expirationDate: Date.now() + 60*1000"
|
" expirationDate: Date.now() + 60*1000"
|
||||||
"})");
|
"})"));
|
||||||
QTRY_COMPARE(cookieAddSpy.count(), 1);
|
QTRY_COMPARE(cookieAddSpy.count(), 1);
|
||||||
QNetworkCookie netCookie = qvariant_cast<QNetworkCookie>(cookieAddSpy.at(0).at(0));
|
QNetworkCookie netCookie = qvariant_cast<QNetworkCookie>(cookieAddSpy.at(0).at(0));
|
||||||
QCOMPARE(netCookie.name(), QByteArrayLiteral("Example"));
|
QCOMPARE(netCookie.name(), QByteArrayLiteral("Example"));
|
||||||
QObject *object = m_testHelper.evaluateQObject("Falkon.Cookies");
|
QObject *object = m_testHelper.evaluateQObject(QSL("Falkon.Cookies"));
|
||||||
QVERIFY(object);
|
QVERIFY(object);
|
||||||
QSignalSpy qmlCookieSpy(object, SIGNAL(changed(QVariantMap)));
|
QSignalSpy qmlCookieSpy(object, SIGNAL(changed(QVariantMap)));
|
||||||
QNetworkCookie anotherNetCookie;
|
QNetworkCookie anotherNetCookie;
|
||||||
anotherNetCookie.setName(QString("Hello").toLocal8Bit());
|
anotherNetCookie.setName(QSL("Hello").toLocal8Bit());
|
||||||
anotherNetCookie.setDomain(".mydomain.com");
|
anotherNetCookie.setDomain(QSL(".mydomain.com"));
|
||||||
anotherNetCookie.setExpirationDate(QDateTime::currentDateTime().addSecs(60));
|
anotherNetCookie.setExpirationDate(QDateTime::currentDateTime().addSecs(60));
|
||||||
mApp->webProfile()->cookieStore()->setCookie(anotherNetCookie);
|
mApp->webProfile()->cookieStore()->setCookie(anotherNetCookie);
|
||||||
QTRY_COMPARE(qmlCookieSpy.count(), 1);
|
QTRY_COMPARE(qmlCookieSpy.count(), 1);
|
||||||
QVariantMap addedQmlCookieMap = QVariant(qmlCookieSpy.at(0).at(0)).toMap();
|
QVariantMap addedQmlCookieMap = QVariant(qmlCookieSpy.at(0).at(0)).toMap();
|
||||||
auto *addedQmlCookie = qvariant_cast<QObject*>(addedQmlCookieMap.value("cookie"));
|
auto *addedQmlCookie = qvariant_cast<QObject*>(addedQmlCookieMap.value(QSL("cookie")));
|
||||||
bool removed = addedQmlCookieMap.value("removed").toBool();
|
bool removed = addedQmlCookieMap.value(QSL("removed")).toBool();
|
||||||
QCOMPARE(addedQmlCookie->property("name").toString(), QSL("Hello"));
|
QCOMPARE(addedQmlCookie->property("name").toString(), QSL("Hello"));
|
||||||
QCOMPARE(removed, false);
|
QCOMPARE(removed, false);
|
||||||
|
|
||||||
mApp->webProfile()->cookieStore()->deleteCookie(netCookie);
|
mApp->webProfile()->cookieStore()->deleteCookie(netCookie);
|
||||||
QTRY_COMPARE(qmlCookieSpy.count(), 2);
|
QTRY_COMPARE(qmlCookieSpy.count(), 2);
|
||||||
QVariantMap removedQmlCookieMap = QVariant(qmlCookieSpy.at(1).at(0)).toMap();
|
QVariantMap removedQmlCookieMap = QVariant(qmlCookieSpy.at(1).at(0)).toMap();
|
||||||
auto *removedQmlCookie = qvariant_cast<QObject*>(removedQmlCookieMap.value("cookie"));
|
auto *removedQmlCookie = qvariant_cast<QObject*>(removedQmlCookieMap.value(QSL("cookie")));
|
||||||
removed = removedQmlCookieMap.value("removed").toBool();
|
removed = removedQmlCookieMap.value(QSL("removed")).toBool();
|
||||||
QCOMPARE(removedQmlCookie->property("name").toString(), QSL("Example"));
|
QCOMPARE(removedQmlCookie->property("name").toString(), QSL("Example"));
|
||||||
QCOMPARE(removed, true);
|
QCOMPARE(removed, true);
|
||||||
|
|
||||||
QSignalSpy cookieRemoveSpy(mApp->cookieJar(), &CookieJar::cookieRemoved);
|
QSignalSpy cookieRemoveSpy(mApp->cookieJar(), &CookieJar::cookieRemoved);
|
||||||
m_testHelper.evaluate("Falkon.Cookies.remove({"
|
m_testHelper.evaluate(QL1S("Falkon.Cookies.remove({"
|
||||||
" name: 'Hello',"
|
" name: 'Hello',"
|
||||||
" url: '.mydomain.com',"
|
" url: '.mydomain.com',"
|
||||||
"})");
|
"})"));
|
||||||
QTRY_COMPARE(cookieRemoveSpy.count(), 1);
|
QTRY_COMPARE(cookieRemoveSpy.count(), 1);
|
||||||
netCookie = qvariant_cast<QNetworkCookie>(cookieRemoveSpy.at(0).at(0));
|
netCookie = qvariant_cast<QNetworkCookie>(cookieRemoveSpy.at(0).at(0));
|
||||||
QCOMPARE(netCookie.name(), QByteArrayLiteral("Hello"));
|
QCOMPARE(netCookie.name(), QByteArrayLiteral("Hello"));
|
||||||
@ -80,20 +80,20 @@ void QmlCookiesApiTest::testCookieGet()
|
|||||||
QSignalSpy cookieAddSpy(mApp->cookieJar(), &CookieJar::cookieAdded);
|
QSignalSpy cookieAddSpy(mApp->cookieJar(), &CookieJar::cookieAdded);
|
||||||
|
|
||||||
QNetworkCookie netCookie_1;
|
QNetworkCookie netCookie_1;
|
||||||
netCookie_1.setName(QString("Apple").toLocal8Bit());
|
netCookie_1.setName(QSL("Apple").toLocal8Bit());
|
||||||
netCookie_1.setDomain(".apple-domain.com");
|
netCookie_1.setDomain(QSL(".apple-domain.com"));
|
||||||
netCookie_1.setExpirationDate(current.addSecs(60));
|
netCookie_1.setExpirationDate(current.addSecs(60));
|
||||||
mApp->webProfile()->cookieStore()->setCookie(netCookie_1);
|
mApp->webProfile()->cookieStore()->setCookie(netCookie_1);
|
||||||
|
|
||||||
QNetworkCookie netCookie_2;
|
QNetworkCookie netCookie_2;
|
||||||
netCookie_2.setName(QString("Mango").toLocal8Bit());
|
netCookie_2.setName(QSL("Mango").toLocal8Bit());
|
||||||
netCookie_2.setDomain(".mango-domain.com");
|
netCookie_2.setDomain(QSL(".mango-domain.com"));
|
||||||
netCookie_2.setExpirationDate(current.addSecs(120));
|
netCookie_2.setExpirationDate(current.addSecs(120));
|
||||||
mApp->webProfile()->cookieStore()->setCookie(netCookie_2);
|
mApp->webProfile()->cookieStore()->setCookie(netCookie_2);
|
||||||
|
|
||||||
QNetworkCookie netCookie_3;
|
QNetworkCookie netCookie_3;
|
||||||
netCookie_3.setName(QString("Mango").toLocal8Bit());
|
netCookie_3.setName(QSL("Mango").toLocal8Bit());
|
||||||
netCookie_3.setDomain(".yet-another-mango-domain.com");
|
netCookie_3.setDomain(QSL(".yet-another-mango-domain.com"));
|
||||||
netCookie_3.setExpirationDate(current.addSecs(180));
|
netCookie_3.setExpirationDate(current.addSecs(180));
|
||||||
mApp->webProfile()->cookieStore()->setCookie(netCookie_3);
|
mApp->webProfile()->cookieStore()->setCookie(netCookie_3);
|
||||||
|
|
||||||
@ -101,20 +101,20 @@ void QmlCookiesApiTest::testCookieGet()
|
|||||||
|
|
||||||
QNetworkCookie actualMangoCookie;
|
QNetworkCookie actualMangoCookie;
|
||||||
for (const QNetworkCookie &cookie : mApp->cookieJar()->getAllCookies()) {
|
for (const QNetworkCookie &cookie : mApp->cookieJar()->getAllCookies()) {
|
||||||
if (cookie.name() == QSL("Mango") && cookie.domain() == QSL(".mango-domain.com")) {
|
if (QString::fromUtf8(cookie.name()) == QSL("Mango") && cookie.domain() == QSL(".mango-domain.com")) {
|
||||||
actualMangoCookie = cookie;
|
actualMangoCookie = cookie;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QObject *mangoCookie = m_testHelper.evaluateQObject("Falkon.Cookies.get({"
|
QObject *mangoCookie = m_testHelper.evaluateQObject(QL1S("Falkon.Cookies.get({"
|
||||||
" name: 'Mango',"
|
" name: 'Mango',"
|
||||||
" url: '.mango-domain.com'"
|
" url: '.mango-domain.com'"
|
||||||
"})");
|
"})"));
|
||||||
QVERIFY(mangoCookie);
|
QVERIFY(mangoCookie);
|
||||||
QCOMPARE(mangoCookie->property("name").toString(), QSL("Mango"));
|
QCOMPARE(mangoCookie->property("name").toString(), QSL("Mango"));
|
||||||
QCOMPARE(mangoCookie->property("expirationDate").toDateTime(), actualMangoCookie.expirationDate());
|
QCOMPARE(mangoCookie->property("expirationDate").toDateTime(), actualMangoCookie.expirationDate());
|
||||||
|
|
||||||
QList<QVariant> mangoCookies = m_testHelper.evaluate("Falkon.Cookies.getAll({name: 'Mango'})").toVariant().toList();
|
QList<QVariant> mangoCookies = m_testHelper.evaluate(QSL("Falkon.Cookies.getAll({name: 'Mango'})")).toVariant().toList();
|
||||||
QCOMPARE(mangoCookies.length(), 2);
|
QCOMPARE(mangoCookies.length(), 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -36,17 +36,17 @@ void QmlHistoryApiTest::testAddition()
|
|||||||
{
|
{
|
||||||
qRegisterMetaType<HistoryEntry>();
|
qRegisterMetaType<HistoryEntry>();
|
||||||
QSignalSpy historySpy(mApp->history(), &History::historyEntryAdded);
|
QSignalSpy historySpy(mApp->history(), &History::historyEntryAdded);
|
||||||
m_testHelper.evaluate("Falkon.History.addUrl({"
|
m_testHelper.evaluate(QL1S("Falkon.History.addUrl({"
|
||||||
" url: 'https://example.com',"
|
" url: 'https://example.com',"
|
||||||
" title: 'Example Domain'"
|
" title: 'Example Domain'"
|
||||||
"})");
|
"})"));
|
||||||
QTRY_COMPARE(historySpy.count(), 1);
|
QTRY_COMPARE(historySpy.count(), 1);
|
||||||
HistoryEntry entry = qvariant_cast<HistoryEntry>(historySpy.at(0).at(0));
|
HistoryEntry entry = qvariant_cast<HistoryEntry>(historySpy.at(0).at(0));
|
||||||
QCOMPARE(entry.title, QSL("Example Domain"));
|
QCOMPARE(entry.title, QSL("Example Domain"));
|
||||||
|
|
||||||
auto object = m_testHelper.evaluateQObject("Falkon.History");
|
auto object = m_testHelper.evaluateQObject(QSL("Falkon.History"));
|
||||||
QSignalSpy qmlHistorySpy(object, SIGNAL(visited(QmlHistoryItem*)));
|
QSignalSpy qmlHistorySpy(object, SIGNAL(visited(QmlHistoryItem*)));
|
||||||
mApp->history()->addHistoryEntry(QUrl("https://sample.com"), "Sample Domain");
|
mApp->history()->addHistoryEntry(QUrl(QSL("https://sample.com")), QSL("Sample Domain"));
|
||||||
QTRY_COMPARE(qmlHistorySpy.count(), 1);
|
QTRY_COMPARE(qmlHistorySpy.count(), 1);
|
||||||
mApp->history()->clearHistory();
|
mApp->history()->clearHistory();
|
||||||
}
|
}
|
||||||
@ -54,34 +54,34 @@ void QmlHistoryApiTest::testAddition()
|
|||||||
void QmlHistoryApiTest::testSearch()
|
void QmlHistoryApiTest::testSearch()
|
||||||
{
|
{
|
||||||
QSignalSpy historySpy(mApp->history(), &History::historyEntryAdded);
|
QSignalSpy historySpy(mApp->history(), &History::historyEntryAdded);
|
||||||
mApp->history()->addHistoryEntry(QUrl("https://example.com"), "Example Domain");
|
mApp->history()->addHistoryEntry(QUrl(QSL("https://example.com")), QSL("Example Domain"));
|
||||||
mApp->history()->addHistoryEntry(QUrl("https://another-example.com"), "Another Example Domain");
|
mApp->history()->addHistoryEntry(QUrl(QSL("https://another-example.com")), QSL("Another Example Domain"));
|
||||||
mApp->history()->addHistoryEntry(QUrl("https://sample.com"), "Sample Domain");
|
mApp->history()->addHistoryEntry(QUrl(QSL("https://sample.com")), QSL("Sample Domain"));
|
||||||
QTRY_COMPARE(historySpy.count(), 3);
|
QTRY_COMPARE(historySpy.count(), 3);
|
||||||
auto list = m_testHelper.evaluate("Falkon.History.search('example')").toVariant().toList();
|
auto list = m_testHelper.evaluate(QSL("Falkon.History.search('example')")).toVariant().toList();
|
||||||
QCOMPARE(list.length(), 2);
|
QCOMPARE(list.length(), 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
void QmlHistoryApiTest::testVisits()
|
void QmlHistoryApiTest::testVisits()
|
||||||
{
|
{
|
||||||
int visits = m_testHelper.evaluate("Falkon.History.getVisits('https://sample.com')").toInt();
|
int visits = m_testHelper.evaluate(QSL("Falkon.History.getVisits('https://sample.com')")).toInt();
|
||||||
QCOMPARE(visits, 1);
|
QCOMPARE(visits, 1);
|
||||||
QSignalSpy historySpy(mApp->history(), &History::historyEntryEdited);
|
QSignalSpy historySpy(mApp->history(), &History::historyEntryEdited);
|
||||||
mApp->history()->addHistoryEntry(QUrl("https://sample.com"), "Sample Domain");
|
mApp->history()->addHistoryEntry(QUrl(QSL("https://sample.com")), QSL("Sample Domain"));
|
||||||
QTRY_COMPARE(historySpy.count(), 1);
|
QTRY_COMPARE(historySpy.count(), 1);
|
||||||
visits = m_testHelper.evaluate("Falkon.History.getVisits('https://sample.com')").toInt();
|
visits = m_testHelper.evaluate(QSL("Falkon.History.getVisits('https://sample.com')")).toInt();
|
||||||
QCOMPARE(visits, 2);
|
QCOMPARE(visits, 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
void QmlHistoryApiTest::testRemoval()
|
void QmlHistoryApiTest::testRemoval()
|
||||||
{
|
{
|
||||||
QSignalSpy historySpy(mApp->history(), &History::historyEntryDeleted);
|
QSignalSpy historySpy(mApp->history(), &History::historyEntryDeleted);
|
||||||
m_testHelper.evaluate("Falkon.History.deleteUrl('https://sample.com')");
|
m_testHelper.evaluate(QSL("Falkon.History.deleteUrl('https://sample.com')"));
|
||||||
QTRY_COMPARE(historySpy.count(), 1);
|
QTRY_COMPARE(historySpy.count(), 1);
|
||||||
|
|
||||||
auto object = m_testHelper.evaluateQObject("Falkon.History");
|
auto object = m_testHelper.evaluateQObject(QSL("Falkon.History"));
|
||||||
QSignalSpy qmlHistorySpy(object, SIGNAL(visitRemoved(QmlHistoryItem*)));
|
QSignalSpy qmlHistorySpy(object, SIGNAL(visitRemoved(QmlHistoryItem*)));
|
||||||
mApp->history()->deleteHistoryEntry("https://example.com", "Example Domain");
|
mApp->history()->deleteHistoryEntry(QSL("https://example.com"), QSL("Example Domain"));
|
||||||
QTRY_COMPARE(qmlHistorySpy.count(), 1);
|
QTRY_COMPARE(qmlHistorySpy.count(), 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -37,12 +37,12 @@ void QmlTabsApiTest::testInitWindowCount()
|
|||||||
void QmlTabsApiTest::testTabsAPI()
|
void QmlTabsApiTest::testTabsAPI()
|
||||||
{
|
{
|
||||||
// Tab Insertion
|
// Tab Insertion
|
||||||
QObject *qmlTabsObject = m_testHelper.evaluateQObject("Falkon.Tabs");
|
QObject *qmlTabsObject = m_testHelper.evaluateQObject(QSL("Falkon.Tabs"));
|
||||||
QVERIFY(qmlTabsObject);
|
QVERIFY(qmlTabsObject);
|
||||||
QSignalSpy qmlTabsInsertedSpy(qmlTabsObject, SIGNAL(tabInserted(QVariantMap)));
|
QSignalSpy qmlTabsInsertedSpy(qmlTabsObject, SIGNAL(tabInserted(QVariantMap)));
|
||||||
m_testHelper.evaluate("Falkon.Tabs.addTab({"
|
m_testHelper.evaluate(QL1S("Falkon.Tabs.addTab({"
|
||||||
" url: 'https://example.com/'"
|
" url: 'https://example.com/'"
|
||||||
"})");
|
"})"));
|
||||||
QCOMPARE(qmlTabsInsertedSpy.count(), 1);
|
QCOMPARE(qmlTabsInsertedSpy.count(), 1);
|
||||||
QVariantMap retMap1 = QVariant(qmlTabsInsertedSpy.at(0).at(0)).toMap();
|
QVariantMap retMap1 = QVariant(qmlTabsInsertedSpy.at(0).at(0)).toMap();
|
||||||
int index1 = retMap1.value(QSL("index"), -1).toInt();
|
int index1 = retMap1.value(QSL("index"), -1).toInt();
|
||||||
@ -50,15 +50,15 @@ void QmlTabsApiTest::testTabsAPI()
|
|||||||
QCOMPARE(index1, 0);
|
QCOMPARE(index1, 0);
|
||||||
QCOMPARE(windowId1, 0);
|
QCOMPARE(windowId1, 0);
|
||||||
|
|
||||||
QObject *qmlTabObject1 = m_testHelper.evaluateQObject("Falkon.Tabs.get({index: 0})");
|
QObject *qmlTabObject1 = m_testHelper.evaluateQObject(QSL("Falkon.Tabs.get({index: 0})"));
|
||||||
QVERIFY(qmlTabObject1);
|
QVERIFY(qmlTabObject1);
|
||||||
QCOMPARE(qmlTabObject1->property("index").toInt(), 0);
|
QCOMPARE(qmlTabObject1->property("index").toInt(), 0);
|
||||||
QCOMPARE(qmlTabObject1->property("pinned").toBool(), false);
|
QCOMPARE(qmlTabObject1->property("pinned").toBool(), false);
|
||||||
QTRY_COMPARE(qmlTabObject1->property("url").toString(), QSL("https://example.com/"));
|
QTRY_COMPARE(qmlTabObject1->property("url").toString(), QSL("https://example.com/"));
|
||||||
|
|
||||||
m_testHelper.evaluate("Falkon.Tabs.addTab({"
|
m_testHelper.evaluate(QL1S("Falkon.Tabs.addTab({"
|
||||||
" url: 'https://another-example.com/',"
|
" url: 'https://another-example.com/',"
|
||||||
"})");
|
"})"));
|
||||||
QCOMPARE(qmlTabsInsertedSpy.count(), 2);
|
QCOMPARE(qmlTabsInsertedSpy.count(), 2);
|
||||||
QVariantMap retMap2 = QVariant(qmlTabsInsertedSpy.at(1).at(0)).toMap();
|
QVariantMap retMap2 = QVariant(qmlTabsInsertedSpy.at(1).at(0)).toMap();
|
||||||
int index2 = retMap2.value(QSL("index"), -1).toInt();
|
int index2 = retMap2.value(QSL("index"), -1).toInt();
|
||||||
@ -66,17 +66,17 @@ void QmlTabsApiTest::testTabsAPI()
|
|||||||
QCOMPARE(index2, 1);
|
QCOMPARE(index2, 1);
|
||||||
QCOMPARE(windowId2, 0);
|
QCOMPARE(windowId2, 0);
|
||||||
|
|
||||||
bool pinnedTab = m_testHelper.evaluate("Falkon.Tabs.pinTab({index: 1})").toBool();
|
bool pinnedTab = m_testHelper.evaluate(QSL("Falkon.Tabs.pinTab({index: 1})")).toBool();
|
||||||
QVERIFY(pinnedTab);
|
QVERIFY(pinnedTab);
|
||||||
QObject *qmlTabObject2 = m_testHelper.evaluateQObject("Falkon.Tabs.get({index: 0})");
|
QObject *qmlTabObject2 = m_testHelper.evaluateQObject(QSL("Falkon.Tabs.get({index: 0})"));
|
||||||
QVERIFY(qmlTabObject2);
|
QVERIFY(qmlTabObject2);
|
||||||
QCOMPARE(qmlTabObject2->property("index").toInt(), 0);
|
QCOMPARE(qmlTabObject2->property("index").toInt(), 0);
|
||||||
QCOMPARE(qmlTabObject2->property("pinned").toBool(), true);
|
QCOMPARE(qmlTabObject2->property("pinned").toBool(), true);
|
||||||
QTRY_COMPARE(qmlTabObject2->property("url").toString(), QSL("https://another-example.com/"));
|
QTRY_COMPARE(qmlTabObject2->property("url").toString(), QSL("https://another-example.com/"));
|
||||||
|
|
||||||
bool unpinnedTab = m_testHelper.evaluate("Falkon.Tabs.unpinTab({index: 0})").toBool();
|
bool unpinnedTab = m_testHelper.evaluate(QSL("Falkon.Tabs.unpinTab({index: 0})")).toBool();
|
||||||
QVERIFY(unpinnedTab);
|
QVERIFY(unpinnedTab);
|
||||||
QObject *qmlTabObject3 = m_testHelper.evaluateQObject("Falkon.Tabs.get({index: 0})");
|
QObject *qmlTabObject3 = m_testHelper.evaluateQObject(QSL("Falkon.Tabs.get({index: 0})"));
|
||||||
QVERIFY(qmlTabObject3);
|
QVERIFY(qmlTabObject3);
|
||||||
QCOMPARE(qmlTabObject3->property("url").toString(), QSL("https://another-example.com/"));
|
QCOMPARE(qmlTabObject3->property("url").toString(), QSL("https://another-example.com/"));
|
||||||
QCOMPARE(qmlTabObject3->property("index").toInt(), 0);
|
QCOMPARE(qmlTabObject3->property("index").toInt(), 0);
|
||||||
@ -84,28 +84,28 @@ void QmlTabsApiTest::testTabsAPI()
|
|||||||
|
|
||||||
// Next-Previous-Current
|
// Next-Previous-Current
|
||||||
QCOMPARE(mApp->getWindow()->tabWidget()->currentIndex(), 0);
|
QCOMPARE(mApp->getWindow()->tabWidget()->currentIndex(), 0);
|
||||||
m_testHelper.evaluate("Falkon.Tabs.nextTab()");
|
m_testHelper.evaluate(QSL("Falkon.Tabs.nextTab()"));
|
||||||
QCOMPARE(mApp->getWindow()->tabWidget()->currentIndex(), 1);
|
QCOMPARE(mApp->getWindow()->tabWidget()->currentIndex(), 1);
|
||||||
m_testHelper.evaluate("Falkon.Tabs.nextTab()");
|
m_testHelper.evaluate(QSL("Falkon.Tabs.nextTab()"));
|
||||||
QCOMPARE(mApp->getWindow()->tabWidget()->currentIndex(), 0);
|
QCOMPARE(mApp->getWindow()->tabWidget()->currentIndex(), 0);
|
||||||
m_testHelper.evaluate("Falkon.Tabs.previousTab()");
|
m_testHelper.evaluate(QSL("Falkon.Tabs.previousTab()"));
|
||||||
QCOMPARE(mApp->getWindow()->tabWidget()->currentIndex(), 1);
|
QCOMPARE(mApp->getWindow()->tabWidget()->currentIndex(), 1);
|
||||||
m_testHelper.evaluate("Falkon.Tabs.previousTab()");
|
m_testHelper.evaluate(QSL("Falkon.Tabs.previousTab()"));
|
||||||
QCOMPARE(mApp->getWindow()->tabWidget()->currentIndex(), 0);
|
QCOMPARE(mApp->getWindow()->tabWidget()->currentIndex(), 0);
|
||||||
m_testHelper.evaluate("Falkon.Tabs.setCurrentIndex({index: 1})");
|
m_testHelper.evaluate(QSL("Falkon.Tabs.setCurrentIndex({index: 1})"));
|
||||||
QCOMPARE(mApp->getWindow()->tabWidget()->currentIndex(), 1);
|
QCOMPARE(mApp->getWindow()->tabWidget()->currentIndex(), 1);
|
||||||
m_testHelper.evaluate("Falkon.Tabs.setCurrentIndex({index: 0})");
|
m_testHelper.evaluate(QSL("Falkon.Tabs.setCurrentIndex({index: 0})"));
|
||||||
QCOMPARE(mApp->getWindow()->tabWidget()->currentIndex(), 0);
|
QCOMPARE(mApp->getWindow()->tabWidget()->currentIndex(), 0);
|
||||||
|
|
||||||
// Move Tab
|
// Move Tab
|
||||||
QSignalSpy qmlTabsMovedSpy(qmlTabsObject, SIGNAL(tabMoved(QVariantMap)));
|
QSignalSpy qmlTabsMovedSpy(qmlTabsObject, SIGNAL(tabMoved(QVariantMap)));
|
||||||
m_testHelper.evaluate("Falkon.Tabs.moveTab({from: 0, to:1, windowId: 0})");
|
m_testHelper.evaluate(QSL("Falkon.Tabs.moveTab({from: 0, to:1, windowId: 0})"));
|
||||||
QCOMPARE(qmlTabsMovedSpy.count(), 1);
|
QCOMPARE(qmlTabsMovedSpy.count(), 1);
|
||||||
|
|
||||||
// Tab Removal
|
// Tab Removal
|
||||||
QCOMPARE(mApp->getWindow()->tabCount(), 2);
|
QCOMPARE(mApp->getWindow()->tabCount(), 2);
|
||||||
QSignalSpy qmlTabsRemovedSpy(qmlTabsObject, SIGNAL(tabRemoved(QVariantMap)));
|
QSignalSpy qmlTabsRemovedSpy(qmlTabsObject, SIGNAL(tabRemoved(QVariantMap)));
|
||||||
m_testHelper.evaluate("Falkon.Tabs.closeTab({index: 0})");
|
m_testHelper.evaluate(QSL("Falkon.Tabs.closeTab({index: 0})"));
|
||||||
QCOMPARE(qmlTabsRemovedSpy.count(), 1);
|
QCOMPARE(qmlTabsRemovedSpy.count(), 1);
|
||||||
QCOMPARE(mApp->getWindow()->tabCount(), 1);
|
QCOMPARE(mApp->getWindow()->tabCount(), 1);
|
||||||
}
|
}
|
||||||
|
@ -31,8 +31,8 @@ void QmlTopSitesApiTest::cleanupTestCase()
|
|||||||
|
|
||||||
void QmlTopSitesApiTest::testTopSites()
|
void QmlTopSitesApiTest::testTopSites()
|
||||||
{
|
{
|
||||||
mApp->plugins()->speedDial()->addPage(QUrl("https://example.com"), "Example Domain");
|
mApp->plugins()->speedDial()->addPage(QUrl(QSL("https://example.com")), QSL("Example Domain"));
|
||||||
auto list = m_testHelper.evaluate("Falkon.TopSites.get()").toVariant().toList();
|
auto list = m_testHelper.evaluate(QSL("Falkon.TopSites.get()")).toVariant().toList();
|
||||||
qDebug() << "Top sites list size=" << list.length();
|
qDebug() << "Top sites list size=" << list.length();
|
||||||
for( const auto& site : list )
|
for( const auto& site : list )
|
||||||
{
|
{
|
||||||
|
@ -34,26 +34,26 @@ void QmlUserScriptApiTest::cleanupTestCase()
|
|||||||
|
|
||||||
void QmlUserScriptApiTest::testCount()
|
void QmlUserScriptApiTest::testCount()
|
||||||
{
|
{
|
||||||
int count = m_testHelper.evaluate("Falkon.UserScripts.count").toInt();
|
int count = m_testHelper.evaluate(QSL("Falkon.UserScripts.count")).toInt();
|
||||||
QCOMPARE(count, mApp->webProfile()->scripts()->count());
|
QCOMPARE(count, mApp->webProfile()->scripts()->count());
|
||||||
}
|
}
|
||||||
|
|
||||||
void QmlUserScriptApiTest::testSize()
|
void QmlUserScriptApiTest::testSize()
|
||||||
{
|
{
|
||||||
int size = m_testHelper.evaluate("Falkon.UserScripts.size").toInt();
|
int size = m_testHelper.evaluate(QSL("Falkon.UserScripts.size")).toInt();
|
||||||
QCOMPARE(size, mApp->webProfile()->scripts()->count());
|
QCOMPARE(size, mApp->webProfile()->scripts()->count());
|
||||||
}
|
}
|
||||||
|
|
||||||
void QmlUserScriptApiTest::testEmpty()
|
void QmlUserScriptApiTest::testEmpty()
|
||||||
{
|
{
|
||||||
bool empty = m_testHelper.evaluate("Falkon.UserScripts.empty").toBool();
|
bool empty = m_testHelper.evaluate(QSL("Falkon.UserScripts.empty")).toBool();
|
||||||
QCOMPARE(empty, mApp->webProfile()->scripts()->isEmpty());
|
QCOMPARE(empty, mApp->webProfile()->scripts()->isEmpty());
|
||||||
}
|
}
|
||||||
|
|
||||||
void QmlUserScriptApiTest::testContains()
|
void QmlUserScriptApiTest::testContains()
|
||||||
{
|
{
|
||||||
QWebEngineScript script = mApp->webProfile()->scripts()->toList().at(0);
|
QWebEngineScript script = mApp->webProfile()->scripts()->toList().at(0);
|
||||||
QObject *object = m_testHelper.evaluateQObject("Falkon.UserScripts");
|
QObject *object = m_testHelper.evaluateQObject(QSL("Falkon.UserScripts"));
|
||||||
auto *userScripts = dynamic_cast<QmlUserScripts*>(object);
|
auto *userScripts = dynamic_cast<QmlUserScripts*>(object);
|
||||||
QVERIFY(userScripts);
|
QVERIFY(userScripts);
|
||||||
auto *userScript = new QmlUserScript();
|
auto *userScript = new QmlUserScript();
|
||||||
@ -65,7 +65,7 @@ void QmlUserScriptApiTest::testContains()
|
|||||||
void QmlUserScriptApiTest::testFind()
|
void QmlUserScriptApiTest::testFind()
|
||||||
{
|
{
|
||||||
QWebEngineScript script = mApp->webProfile()->scripts()->toList().at(0);
|
QWebEngineScript script = mApp->webProfile()->scripts()->toList().at(0);
|
||||||
QObject *object = m_testHelper.evaluateQObject("Falkon.UserScripts");
|
QObject *object = m_testHelper.evaluateQObject(QSL("Falkon.UserScripts"));
|
||||||
auto *userScripts = dynamic_cast<QmlUserScripts*>(object);
|
auto *userScripts = dynamic_cast<QmlUserScripts*>(object);
|
||||||
QVERIFY(userScripts);
|
QVERIFY(userScripts);
|
||||||
QObject *scriptFound = userScripts->findScript(script.name());
|
QObject *scriptFound = userScripts->findScript(script.name());
|
||||||
@ -75,22 +75,22 @@ void QmlUserScriptApiTest::testFind()
|
|||||||
|
|
||||||
void QmlUserScriptApiTest::testInsertRemove()
|
void QmlUserScriptApiTest::testInsertRemove()
|
||||||
{
|
{
|
||||||
int initialCount = m_testHelper.evaluate("Falkon.UserScripts.count").toInt();
|
int initialCount = m_testHelper.evaluate(QSL("Falkon.UserScripts.count")).toInt();
|
||||||
QObject *object = m_testHelper.evaluateQObject("Falkon.UserScripts");
|
QObject *object = m_testHelper.evaluateQObject(QSL("Falkon.UserScripts"));
|
||||||
auto *userScripts = dynamic_cast<QmlUserScripts*>(object);
|
auto *userScripts = dynamic_cast<QmlUserScripts*>(object);
|
||||||
QVERIFY(userScripts);
|
QVERIFY(userScripts);
|
||||||
auto *userScript = new QmlUserScript();
|
auto *userScript = new QmlUserScript();
|
||||||
userScript->setProperty("name", "Hello World");
|
userScript->setProperty("name", QSL("Hello World"));
|
||||||
userScript->setProperty("sourceCode", "(function() {"
|
userScript->setProperty("sourceCode", QL1S("(function() {"
|
||||||
" alert('Hello World')"
|
" alert('Hello World')"
|
||||||
"})()");
|
"})()"));
|
||||||
userScripts->insert(userScript);
|
userScripts->insert(userScript);
|
||||||
int finalCount = m_testHelper.evaluate("Falkon.UserScripts.count").toInt();
|
int finalCount = m_testHelper.evaluate(QSL("Falkon.UserScripts.count")).toInt();
|
||||||
QCOMPARE(finalCount, initialCount + 1);
|
QCOMPARE(finalCount, initialCount + 1);
|
||||||
|
|
||||||
userScripts->remove(userScript);
|
userScripts->remove(userScript);
|
||||||
|
|
||||||
int ultimateCount = m_testHelper.evaluate("Falkon.UserScripts.count").toInt();
|
int ultimateCount = m_testHelper.evaluate(QSL("Falkon.UserScripts.count")).toInt();
|
||||||
QCOMPARE(ultimateCount, initialCount);
|
QCOMPARE(ultimateCount, initialCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -32,13 +32,13 @@ void QmlWindowsApiTest::cleanupTestCase()
|
|||||||
|
|
||||||
void QmlWindowsApiTest::testWindowsAPI()
|
void QmlWindowsApiTest::testWindowsAPI()
|
||||||
{
|
{
|
||||||
QObject *currentWindowObject = m_testHelper.evaluateQObject("Falkon.Windows.getCurrent()");
|
QObject *currentWindowObject = m_testHelper.evaluateQObject(QSL("Falkon.Windows.getCurrent()"));
|
||||||
QVERIFY(currentWindowObject);
|
QVERIFY(currentWindowObject);
|
||||||
QCOMPARE(currentWindowObject->property("title").toString(), mApp->getWindow()->windowTitle());
|
QCOMPARE(currentWindowObject->property("title").toString(), mApp->getWindow()->windowTitle());
|
||||||
QCOMPARE(currentWindowObject->property("type").toInt(), (int)mApp->getWindow()->windowType());
|
QCOMPARE(currentWindowObject->property("type").toInt(), (int)mApp->getWindow()->windowType());
|
||||||
QCOMPARE(currentWindowObject->property("tabs").toList().length(), mApp->getWindow()->tabCount());
|
QCOMPARE(currentWindowObject->property("tabs").toList().length(), mApp->getWindow()->tabCount());
|
||||||
|
|
||||||
QObject *windowObject = m_testHelper.evaluateQObject("Falkon.Windows");
|
QObject *windowObject = m_testHelper.evaluateQObject(QSL("Falkon.Windows"));
|
||||||
QVERIFY(windowObject);
|
QVERIFY(windowObject);
|
||||||
QSignalSpy qmlWindowCreatedSignal(windowObject, SIGNAL(created(QmlWindow*)));
|
QSignalSpy qmlWindowCreatedSignal(windowObject, SIGNAL(created(QmlWindow*)));
|
||||||
qRegisterMetaType<BrowserWindow*>();
|
qRegisterMetaType<BrowserWindow*>();
|
||||||
@ -48,7 +48,7 @@ void QmlWindowsApiTest::testWindowsAPI()
|
|||||||
QTRY_COMPARE(qmlWindowCreatedSignal.count(), 1);
|
QTRY_COMPARE(qmlWindowCreatedSignal.count(), 1);
|
||||||
QTRY_COMPARE(windowCreatedSingal.count(), 1);
|
QTRY_COMPARE(windowCreatedSingal.count(), 1);
|
||||||
|
|
||||||
QObject *newQmlWindow = m_testHelper.evaluateQObject("Falkon.Windows.create({})");
|
QObject *newQmlWindow = m_testHelper.evaluateQObject(QSL("Falkon.Windows.create({})"));
|
||||||
QVERIFY(newQmlWindow);
|
QVERIFY(newQmlWindow);
|
||||||
QCOMPARE(mApp->windowCount(), 2);
|
QCOMPARE(mApp->windowCount(), 2);
|
||||||
|
|
||||||
@ -60,12 +60,12 @@ void QmlWindowsApiTest::testWindowsAPI()
|
|||||||
QVERIFY(newQmlSignalWindow);
|
QVERIFY(newQmlSignalWindow);
|
||||||
QCOMPARE(newQmlWindow->property("id").toInt(), newQmlSignalWindow->property("id").toInt());
|
QCOMPARE(newQmlWindow->property("id").toInt(), newQmlSignalWindow->property("id").toInt());
|
||||||
|
|
||||||
int qmlWindowCount = m_testHelper.evaluate("Falkon.Windows.getAll().length").toInt();
|
int qmlWindowCount = m_testHelper.evaluate(QSL("Falkon.Windows.getAll().length")).toInt();
|
||||||
QCOMPARE(qmlWindowCount, mApp->windowCount());
|
QCOMPARE(qmlWindowCount, mApp->windowCount());
|
||||||
|
|
||||||
QSignalSpy qmlWindowRemovedSignal(windowObject, SIGNAL(removed(QmlWindow*)));
|
QSignalSpy qmlWindowRemovedSignal(windowObject, SIGNAL(removed(QmlWindow*)));
|
||||||
int newQmlWindowId = newQmlSignalWindow->property("id").toInt();
|
int newQmlWindowId = newQmlSignalWindow->property("id").toInt();
|
||||||
m_testHelper.evaluate(QString("Falkon.Windows.remove(%1)").arg(newQmlWindowId));
|
m_testHelper.evaluate(QString(QSL("Falkon.Windows.remove(%1)")).arg(newQmlWindowId));
|
||||||
QTRY_COMPARE(qmlWindowRemovedSignal.count(), 1);
|
QTRY_COMPARE(qmlWindowRemovedSignal.count(), 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -65,15 +65,15 @@ void QzToolsTest::getFileNameFromUrl_data()
|
|||||||
QTest::addColumn<QUrl>("url");
|
QTest::addColumn<QUrl>("url");
|
||||||
QTest::addColumn<QString>("result");
|
QTest::addColumn<QString>("result");
|
||||||
|
|
||||||
QTest::newRow("Basic") << QUrl("http://www.google.com/filename.html") << "filename.html";
|
QTest::newRow("Basic") << QUrl(QSL("http://www.google.com/filename.html")) << QSL("filename.html");
|
||||||
QTest::newRow("OnlyHost") << QUrl("http://www.google.com/") << "www.google.com";
|
QTest::newRow("OnlyHost") << QUrl(QSL("http://www.google.com/")) << QSL("www.google.com");
|
||||||
QTest::newRow("OnlyHostWithoutSlash") << QUrl("http://www.google.com") << "www.google.com";
|
QTest::newRow("OnlyHostWithoutSlash") << QUrl(QSL("http://www.google.com")) << QSL("www.google.com");
|
||||||
QTest::newRow("EndingDirectory") << QUrl("http://www.google.com/filename/") << "filename";
|
QTest::newRow("EndingDirectory") << QUrl(QSL("http://www.google.com/filename/")) << QSL("filename");
|
||||||
QTest::newRow("EmptyUrl") << QUrl("") << "";
|
QTest::newRow("EmptyUrl") << QUrl(QSL("")) << QSL("");
|
||||||
QTest::newRow("OnlyScheme") << QUrl("http:") << "";
|
QTest::newRow("OnlyScheme") << QUrl(QSL("http:")) << QSL("");
|
||||||
QTest::newRow("FileSchemeUrl") << QUrl("file:///usr/share/test/file.tx") << "file.tx";
|
QTest::newRow("FileSchemeUrl") << QUrl(QSL("file:///usr/share/test/file.tx")) << QSL("file.tx");
|
||||||
QTest::newRow("FileSchemeUrlDirectory") << QUrl("file:///usr/share/test/") << "test";
|
QTest::newRow("FileSchemeUrlDirectory") << QUrl(QSL("file:///usr/share/test/")) << QSL("test");
|
||||||
QTest::newRow("FileSchemeUrlRoot") << QUrl("file:///") << "";
|
QTest::newRow("FileSchemeUrlRoot") << QUrl(QSL("file:///")) << QSL("");
|
||||||
}
|
}
|
||||||
|
|
||||||
void QzToolsTest::getFileNameFromUrl()
|
void QzToolsTest::getFileNameFromUrl()
|
||||||
@ -90,37 +90,37 @@ void QzToolsTest::splitCommandArguments_data()
|
|||||||
QTest::addColumn<QStringList>("result");
|
QTest::addColumn<QStringList>("result");
|
||||||
|
|
||||||
QTest::newRow("Basic") << "/usr/bin/foo -o foo.out"
|
QTest::newRow("Basic") << "/usr/bin/foo -o foo.out"
|
||||||
<< (QStringList() << "/usr/bin/foo" << "-o" << "foo.out");
|
<< (QStringList() << QSL("/usr/bin/foo") << QSL("-o") << QSL("foo.out"));
|
||||||
QTest::newRow("Empty") << QString()
|
QTest::newRow("Empty") << QString()
|
||||||
<< QStringList();
|
<< QStringList();
|
||||||
QTest::newRow("OnlySpaces") << QString(" ")
|
QTest::newRow("OnlySpaces") << QSL(" ")
|
||||||
<< QStringList();
|
<< QStringList();
|
||||||
QTest::newRow("OnlyQuotes") << QString(R"("" "")")
|
QTest::newRow("OnlyQuotes") << QSL(R"("" "")")
|
||||||
<< QStringList();
|
<< QStringList();
|
||||||
QTest::newRow("EmptyQuotesAndSpace") << QString(R"("" "" " ")")
|
QTest::newRow("EmptyQuotesAndSpace") << QSL(R"("" "" " ")")
|
||||||
<< QStringList(" ");
|
<< QStringList(QSL(" "));
|
||||||
QTest::newRow("MultipleSpaces") << " /usr/foo -o foo.out "
|
QTest::newRow("MultipleSpaces") << " /usr/foo -o foo.out "
|
||||||
<< (QStringList() << "/usr/foo" << "-o" << "foo.out");
|
<< (QStringList() << QSL("/usr/foo") << QSL("-o") << QSL("foo.out"));
|
||||||
QTest::newRow("Quotes") << R"("/usr/foo" "-o" "foo.out")"
|
QTest::newRow("Quotes") << R"("/usr/foo" "-o" "foo.out")"
|
||||||
<< (QStringList() << "/usr/foo" << "-o" << "foo.out");
|
<< (QStringList() << QSL("/usr/foo") << QSL("-o") << QSL("foo.out"));
|
||||||
QTest::newRow("SingleQuotes") << "'/usr/foo' '-o' 'foo.out'"
|
QTest::newRow("SingleQuotes") << "'/usr/foo' '-o' 'foo.out'"
|
||||||
<< (QStringList() << "/usr/foo" << "-o" << "foo.out");
|
<< (QStringList() << QSL("/usr/foo") << QSL("-o") << QSL("foo.out"));
|
||||||
QTest::newRow("SingleAndDoubleQuotes") << " '/usr/foo' \"-o\" 'foo.out' "
|
QTest::newRow("SingleAndDoubleQuotes") << " '/usr/foo' \"-o\" 'foo.out' "
|
||||||
<< (QStringList() << "/usr/foo" << "-o" << "foo.out");
|
<< (QStringList() << QSL("/usr/foo") << QSL("-o") << QSL("foo.out"));
|
||||||
QTest::newRow("SingleInDoubleQuotes") << "/usr/foo \"-o 'ds' \" 'foo.out' "
|
QTest::newRow("SingleInDoubleQuotes") << "/usr/foo \"-o 'ds' \" 'foo.out' "
|
||||||
<< (QStringList() << "/usr/foo" << "-o 'ds' " << "foo.out");
|
<< (QStringList() << QSL("/usr/foo") << QSL("-o 'ds' ") << QSL("foo.out"));
|
||||||
QTest::newRow("DoubleInSingleQuotes") << "/usr/foo -o 'foo\" d \".out' "
|
QTest::newRow("DoubleInSingleQuotes") << "/usr/foo -o 'foo\" d \".out' "
|
||||||
<< (QStringList() << "/usr/foo" << "-o" << "foo\" d \".out");
|
<< (QStringList() << QSL("/usr/foo") << QSL("-o") << QSL("foo\" d \".out"));
|
||||||
QTest::newRow("SpacesWithQuotes") << QString(R"( " " " " )")
|
QTest::newRow("SpacesWithQuotes") << QSL(R"( " " " " )")
|
||||||
<< (QStringList() << " " << " ");
|
<< (QStringList() << QSL(" ") << QSL(" "));
|
||||||
QTest::newRow("QuotesAndSpaces") << "/usr/foo -o \"foo - out\""
|
QTest::newRow("QuotesAndSpaces") << "/usr/foo -o \"foo - out\""
|
||||||
<< (QStringList() << "/usr/foo" << "-o" << "foo - out");
|
<< (QStringList() << QSL("/usr/foo") << QSL("-o") << QSL("foo - out"));
|
||||||
QTest::newRow("EqualAndQuotes") << "/usr/foo -o=\"foo - out\""
|
QTest::newRow("EqualAndQuotes") << "/usr/foo -o=\"foo - out\""
|
||||||
<< (QStringList() << "/usr/foo" << "-o=foo - out");
|
<< (QStringList() << QSL("/usr/foo") << QSL("-o=foo - out"));
|
||||||
QTest::newRow("EqualWithSpaces") << "/usr/foo -o = \"foo - out\""
|
QTest::newRow("EqualWithSpaces") << "/usr/foo -o = \"foo - out\""
|
||||||
<< (QStringList() << "/usr/foo" << "-o" << "=" << "foo - out");
|
<< (QStringList() << QSL("/usr/foo") << QSL("-o") << QSL("=") << QSL("foo - out"));
|
||||||
QTest::newRow("MultipleSpacesAndQuotes") << " /usr/foo -o=\" foo.out \" "
|
QTest::newRow("MultipleSpacesAndQuotes") << " /usr/foo -o=\" foo.out \" "
|
||||||
<< (QStringList() << "/usr/foo" << "-o= foo.out ");
|
<< (QStringList() << QSL("/usr/foo") << QSL("-o= foo.out "));
|
||||||
// Unmatched quotes should be treated as an error
|
// Unmatched quotes should be treated as an error
|
||||||
QTest::newRow("UnmatchedQuote") << "/usr/bin/foo -o \"bar"
|
QTest::newRow("UnmatchedQuote") << "/usr/bin/foo -o \"bar"
|
||||||
<< QStringList();
|
<< QStringList();
|
||||||
@ -275,17 +275,17 @@ static void createTestDirectoryStructure(const QString &path)
|
|||||||
{
|
{
|
||||||
QDir().mkdir(path);
|
QDir().mkdir(path);
|
||||||
QDir dir(path);
|
QDir dir(path);
|
||||||
dir.mkdir("dir1");
|
dir.mkdir(QSL("dir1"));
|
||||||
dir.mkdir("dir2");
|
dir.mkdir(QSL("dir2"));
|
||||||
dir.mkdir("dir3");
|
dir.mkdir(QSL("dir3"));
|
||||||
dir.cd("dir1");
|
dir.cd(QSL("dir1"));
|
||||||
dir.mkdir("dir1_1");
|
dir.mkdir(QSL("dir1_1"));
|
||||||
dir.mkdir("dir1_2");
|
dir.mkdir(QSL("dir1_2"));
|
||||||
dir.mkdir("dir1_3");
|
dir.mkdir(QSL("dir1_3"));
|
||||||
dir.cdUp();
|
dir.cdUp();
|
||||||
dir.cd("dir3");
|
dir.cd(QSL("dir3"));
|
||||||
dir.mkdir("dir3_1");
|
dir.mkdir(QSL("dir3_1"));
|
||||||
QFile file(path + "/dir1/dir1_2/file1.txt");
|
QFile file(path + QSL("/dir1/dir1_2/file1.txt"));
|
||||||
file.open(QFile::WriteOnly);
|
file.open(QFile::WriteOnly);
|
||||||
file.write("test");
|
file.write("test");
|
||||||
file.close();
|
file.close();
|
||||||
@ -296,32 +296,32 @@ void QzToolsTest::copyRecursivelyTest()
|
|||||||
const QString testDir = createPath("copyRecursivelyTest");
|
const QString testDir = createPath("copyRecursivelyTest");
|
||||||
createTestDirectoryStructure(testDir);
|
createTestDirectoryStructure(testDir);
|
||||||
|
|
||||||
QVERIFY(!QFileInfo(testDir + "-copy").exists());
|
QVERIFY(!QFileInfo(testDir + QSL("-copy")).exists());
|
||||||
|
|
||||||
// Copy to non-existent target
|
// Copy to non-existent target
|
||||||
QCOMPARE(QzTools::copyRecursively(testDir, testDir + "-copy"), true);
|
QCOMPARE(QzTools::copyRecursively(testDir, testDir + QSL("-copy")), true);
|
||||||
|
|
||||||
QCOMPARE(QFileInfo(testDir + "-copy").isDir(), true);
|
QCOMPARE(QFileInfo(testDir + QSL("-copy")).isDir(), true);
|
||||||
QCOMPARE(QFileInfo(testDir + "-copy/dir1").isDir(), true);
|
QCOMPARE(QFileInfo(testDir + QSL("-copy/dir1")).isDir(), true);
|
||||||
QCOMPARE(QFileInfo(testDir + "-copy/dir2").isDir(), true);
|
QCOMPARE(QFileInfo(testDir + QSL("-copy/dir2")).isDir(), true);
|
||||||
QCOMPARE(QFileInfo(testDir + "-copy/dir3").isDir(), true);
|
QCOMPARE(QFileInfo(testDir + QSL("-copy/dir3")).isDir(), true);
|
||||||
QCOMPARE(QFileInfo(testDir + "-copy/dir1/dir1_1").isDir(), true);
|
QCOMPARE(QFileInfo(testDir + QSL("-copy/dir1/dir1_1")).isDir(), true);
|
||||||
QCOMPARE(QFileInfo(testDir + "-copy/dir1/dir1_2").isDir(), true);
|
QCOMPARE(QFileInfo(testDir + QSL("-copy/dir1/dir1_2")).isDir(), true);
|
||||||
QCOMPARE(QFileInfo(testDir + "-copy/dir1/dir1_3").isDir(), true);
|
QCOMPARE(QFileInfo(testDir + QSL("-copy/dir1/dir1_3")).isDir(), true);
|
||||||
QCOMPARE(QFileInfo(testDir + "-copy/dir3/dir3_1").isDir(), true);
|
QCOMPARE(QFileInfo(testDir + QSL("-copy/dir3/dir3_1")).isDir(), true);
|
||||||
QCOMPARE(QFileInfo(testDir + "-copy/dir1/dir1_2/file1.txt").isFile(), true);
|
QCOMPARE(QFileInfo(testDir + QSL("-copy/dir1/dir1_2/file1.txt")).isFile(), true);
|
||||||
|
|
||||||
QFile file(testDir + "-copy/dir1/dir1_2/file1.txt");
|
QFile file(testDir + QSL("-copy/dir1/dir1_2/file1.txt"));
|
||||||
file.open(QFile::ReadOnly);
|
file.open(QFile::ReadOnly);
|
||||||
QCOMPARE(file.readAll(), QByteArray("test"));
|
QCOMPARE(file.readAll(), QByteArray("test"));
|
||||||
file.close();
|
file.close();
|
||||||
|
|
||||||
// Copy to target that already exists
|
// Copy to target that already exists
|
||||||
QCOMPARE(QzTools::copyRecursively(testDir, testDir + "-copy"), false);
|
QCOMPARE(QzTools::copyRecursively(testDir, testDir + QSL("-copy")), false);
|
||||||
|
|
||||||
// Cleanup
|
// Cleanup
|
||||||
QCOMPARE(QzTools::removeRecursively(testDir), true);
|
QCOMPARE(QzTools::removeRecursively(testDir), true);
|
||||||
QCOMPARE(QzTools::removeRecursively(testDir + "-copy"), true);
|
QCOMPARE(QzTools::removeRecursively(testDir + QSL("-copy")), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void QzToolsTest::removeRecursivelyTest()
|
void QzToolsTest::removeRecursivelyTest()
|
||||||
@ -329,23 +329,23 @@ void QzToolsTest::removeRecursivelyTest()
|
|||||||
const QString testDir = createPath("removeRecursivelyTest");
|
const QString testDir = createPath("removeRecursivelyTest");
|
||||||
createTestDirectoryStructure(testDir);
|
createTestDirectoryStructure(testDir);
|
||||||
|
|
||||||
QCOMPARE(QzTools::copyRecursively(testDir, testDir + "-copy"), true);
|
QCOMPARE(QzTools::copyRecursively(testDir, testDir + QSL("-copy")), true);
|
||||||
QCOMPARE(QzTools::removeRecursively(testDir + "-copy"), true);
|
QCOMPARE(QzTools::removeRecursively(testDir + QSL("-copy")), true);
|
||||||
QCOMPARE(QFileInfo(testDir + "-copy").exists(), false);
|
QCOMPARE(QFileInfo(testDir + QSL("-copy")).exists(), false);
|
||||||
|
|
||||||
// Remove non-existent path returns success
|
// Remove non-existent path returns success
|
||||||
QCOMPARE(QzTools::removeRecursively(testDir + "-copy"), true);
|
QCOMPARE(QzTools::removeRecursively(testDir + QSL("-copy")), true);
|
||||||
|
|
||||||
QCOMPARE(QzTools::copyRecursively(testDir, testDir + "-copy2"), true);
|
QCOMPARE(QzTools::copyRecursively(testDir, testDir + QSL("-copy2")), true);
|
||||||
|
|
||||||
QFile dir(testDir + "-copy2");
|
QFile dir(testDir + QSL("-copy2"));
|
||||||
dir.setPermissions(dir.permissions() & ~(QFile::WriteOwner | QFile::WriteUser | QFile::WriteGroup | QFile::WriteOther));
|
dir.setPermissions(dir.permissions() & ~(QFile::WriteOwner | QFile::WriteUser | QFile::WriteGroup | QFile::WriteOther));
|
||||||
|
|
||||||
QCOMPARE(QzTools::removeRecursively(testDir + "-copy2"), false);
|
QCOMPARE(QzTools::removeRecursively(testDir + QSL("-copy2")), false);
|
||||||
|
|
||||||
dir.setPermissions(dir.permissions() | QFile::WriteOwner);
|
dir.setPermissions(dir.permissions() | QFile::WriteOwner);
|
||||||
|
|
||||||
QCOMPARE(QzTools::removeRecursively(testDir + "-copy2"), true);
|
QCOMPARE(QzTools::removeRecursively(testDir + QSL("-copy2")), true);
|
||||||
|
|
||||||
// Cleanup
|
// Cleanup
|
||||||
QCOMPARE(QzTools::removeRecursively(testDir), true);
|
QCOMPARE(QzTools::removeRecursively(testDir), true);
|
||||||
@ -356,21 +356,21 @@ void QzToolsTest::dontFollowSymlinksTest()
|
|||||||
const QString testDir = createPath("removeRecursivelyTest");
|
const QString testDir = createPath("removeRecursivelyTest");
|
||||||
createTestDirectoryStructure(testDir);
|
createTestDirectoryStructure(testDir);
|
||||||
|
|
||||||
QDir().mkpath(testDir + "/subdir");
|
QDir().mkpath(testDir + QSL("/subdir"));
|
||||||
QFile::link(testDir, testDir + "/subdir/link");
|
QFile::link(testDir, testDir + QSL("/subdir/link"));
|
||||||
|
|
||||||
QVERIFY(QzTools::removeRecursively(testDir + "/subdir"));
|
QVERIFY(QzTools::removeRecursively(testDir + QSL("/subdir")));
|
||||||
|
|
||||||
QVERIFY(!QFile::exists(testDir + "/subdir"));
|
QVERIFY(!QFile::exists(testDir + QSL("/subdir")));
|
||||||
QVERIFY(QFile::exists(testDir));
|
QVERIFY(QFile::exists(testDir));
|
||||||
|
|
||||||
QDir().mkpath(testDir + "/subdir/normalfolder");
|
QDir().mkpath(testDir + QSL("/subdir/normalfolder"));
|
||||||
QFile::link("..", testDir + "/subdir/link");
|
QFile::link(QSL(".."), testDir + QSL("/subdir/link"));
|
||||||
|
|
||||||
QVERIFY(QzTools::copyRecursively(testDir + "/subdir", testDir + "/subdir2"));
|
QVERIFY(QzTools::copyRecursively(testDir + QSL("/subdir"), testDir + QSL("/subdir2")));
|
||||||
|
|
||||||
QCOMPARE(QFile::exists(testDir + "/subdir2/link"), true);
|
QCOMPARE(QFile::exists(testDir + QSL("/subdir2/link")), true);
|
||||||
QCOMPARE(QFile::exists(testDir + "/subdir2/normalfolder"), true);
|
QCOMPARE(QFile::exists(testDir + QSL("/subdir2/normalfolder")), true);
|
||||||
|
|
||||||
// Cleanup
|
// Cleanup
|
||||||
QCOMPARE(QzTools::removeRecursively(testDir), true);
|
QCOMPARE(QzTools::removeRecursively(testDir), true);
|
||||||
@ -378,7 +378,7 @@ void QzToolsTest::dontFollowSymlinksTest()
|
|||||||
|
|
||||||
QString QzToolsTest::createPath(const char *file) const
|
QString QzToolsTest::createPath(const char *file) const
|
||||||
{
|
{
|
||||||
return m_tmpPath + QL1S("/") + file;
|
return m_tmpPath + QL1S("/") + QString::fromUtf8(file);
|
||||||
}
|
}
|
||||||
|
|
||||||
QTEST_GUILESS_MAIN(QzToolsTest)
|
QTEST_GUILESS_MAIN(QzToolsTest)
|
||||||
|
@ -58,7 +58,7 @@ void TabModelTest::basicTest()
|
|||||||
|
|
||||||
rowsInsertedSpy.clear();
|
rowsInsertedSpy.clear();
|
||||||
|
|
||||||
w->tabWidget()->addView(QUrl("http://test.com"));
|
w->tabWidget()->addView(QUrl(QSL("http://test.com")));
|
||||||
|
|
||||||
QCOMPARE(rowsInsertedSpy.count(), 1);
|
QCOMPARE(rowsInsertedSpy.count(), 1);
|
||||||
WebTab *tab1 = w->tabWidget()->webTab(1);
|
WebTab *tab1 = w->tabWidget()->webTab(1);
|
||||||
@ -114,7 +114,7 @@ void TabModelTest::dataTest()
|
|||||||
QCOMPARE(model.index(0, 0).data(TabModel::RestoredRole).toBool(), tab0->isRestored());
|
QCOMPARE(model.index(0, 0).data(TabModel::RestoredRole).toBool(), tab0->isRestored());
|
||||||
QCOMPARE(model.index(0, 0).data(TabModel::CurrentTabRole).toBool(), true);
|
QCOMPARE(model.index(0, 0).data(TabModel::CurrentTabRole).toBool(), true);
|
||||||
|
|
||||||
w->tabWidget()->addView(QUrl("http://test.com"));
|
w->tabWidget()->addView(QUrl(QSL("http://test.com")));
|
||||||
|
|
||||||
delete w;
|
delete w;
|
||||||
}
|
}
|
||||||
@ -125,7 +125,7 @@ void TabModelTest::pinTabTest()
|
|||||||
TabModel model(w);
|
TabModel model(w);
|
||||||
ModelTest modelTest(&model);
|
ModelTest modelTest(&model);
|
||||||
|
|
||||||
w->tabWidget()->addView(QUrl("http://test.com"));
|
w->tabWidget()->addView(QUrl(QSL("http://test.com")));
|
||||||
|
|
||||||
QTRY_COMPARE(model.rowCount(), 2);
|
QTRY_COMPARE(model.rowCount(), 2);
|
||||||
|
|
||||||
|
@ -257,27 +257,27 @@ void WebTabTest::loadNotRestoredTabTest()
|
|||||||
{
|
{
|
||||||
WebTab tab;
|
WebTab tab;
|
||||||
|
|
||||||
tab.load(QUrl("qrc:autotests/data/basic_page.html"));
|
tab.load(QUrl(QSL("qrc:autotests/data/basic_page.html")));
|
||||||
QVERIFY(waitForLoadfinished(&tab));
|
QVERIFY(waitForLoadfinished(&tab));
|
||||||
QTRY_COMPARE(tab.webView()->history()->count(), 1);
|
QTRY_COMPARE(tab.webView()->history()->count(), 1);
|
||||||
|
|
||||||
tab.unload();
|
tab.unload();
|
||||||
QVERIFY(!tab.isRestored());
|
QVERIFY(!tab.isRestored());
|
||||||
|
|
||||||
tab.load(QUrl("qrc:autotests/data/basic_page2.html"));
|
tab.load(QUrl(QSL("qrc:autotests/data/basic_page2.html")));
|
||||||
QVERIFY(waitForLoadfinished(&tab));
|
QVERIFY(waitForLoadfinished(&tab));
|
||||||
QTRY_COMPARE(tab.webView()->history()->count(), 2);
|
QTRY_COMPARE(tab.webView()->history()->count(), 2);
|
||||||
|
|
||||||
QCOMPARE(tab.url(), QUrl("qrc:autotests/data/basic_page2.html"));
|
QCOMPARE(tab.url(), QUrl(QSL("qrc:autotests/data/basic_page2.html")));
|
||||||
QCOMPARE(tab.webView()->history()->currentItem().url(), QUrl("qrc:autotests/data/basic_page2.html"));
|
QCOMPARE(tab.webView()->history()->currentItem().url(), QUrl(QSL("qrc:autotests/data/basic_page2.html")));
|
||||||
QCOMPARE(tab.webView()->history()->backItem().url(), QUrl("qrc:autotests/data/basic_page.html"));
|
QCOMPARE(tab.webView()->history()->backItem().url(), QUrl(QSL("qrc:autotests/data/basic_page.html")));
|
||||||
}
|
}
|
||||||
|
|
||||||
void WebTabTest::saveNotRestoredTabTest()
|
void WebTabTest::saveNotRestoredTabTest()
|
||||||
{
|
{
|
||||||
WebTab tab;
|
WebTab tab;
|
||||||
|
|
||||||
tab.load(QUrl("qrc:autotests/data/basic_page.html"));
|
tab.load(QUrl(QSL("qrc:autotests/data/basic_page.html")));
|
||||||
QVERIFY(waitForLoadfinished(&tab));
|
QVERIFY(waitForLoadfinished(&tab));
|
||||||
QTRY_COMPARE(tab.webView()->history()->count(), 1);
|
QTRY_COMPARE(tab.webView()->history()->count(), 1);
|
||||||
|
|
||||||
@ -286,7 +286,7 @@ void WebTabTest::saveNotRestoredTabTest()
|
|||||||
|
|
||||||
WebTab::SavedTab saved(&tab);
|
WebTab::SavedTab saved(&tab);
|
||||||
QVERIFY(saved.isValid());
|
QVERIFY(saved.isValid());
|
||||||
QCOMPARE(saved.url, QUrl("qrc:autotests/data/basic_page.html"));
|
QCOMPARE(saved.url, QUrl(QSL("qrc:autotests/data/basic_page.html")));
|
||||||
}
|
}
|
||||||
|
|
||||||
FALKONTEST_MAIN(WebTabTest)
|
FALKONTEST_MAIN(WebTabTest)
|
||||||
|
@ -73,7 +73,7 @@ void WebViewTest::loadSignalsChangePageTest()
|
|||||||
QSignalSpy loadStartedSpy(&view, &WebView::loadStarted);
|
QSignalSpy loadStartedSpy(&view, &WebView::loadStarted);
|
||||||
QSignalSpy loadFinishedSpy(&view, &WebView::loadFinished);
|
QSignalSpy loadFinishedSpy(&view, &WebView::loadFinished);
|
||||||
|
|
||||||
view.load(QUrl("qrc:autotests/data/basic_page.html"));
|
view.load(QUrl(QSL("qrc:autotests/data/basic_page.html")));
|
||||||
|
|
||||||
QTRY_COMPARE(loadStartedSpy.count(), 1);
|
QTRY_COMPARE(loadStartedSpy.count(), 1);
|
||||||
loadStartedSpy.clear();
|
loadStartedSpy.clear();
|
||||||
@ -93,7 +93,7 @@ void WebViewTest::loadSignalsChangePageTest()
|
|||||||
view2.setPage(page3);
|
view2.setPage(page3);
|
||||||
|
|
||||||
QSignalSpy page3LoadStart(page3, &WebPage::loadStarted);
|
QSignalSpy page3LoadStart(page3, &WebPage::loadStarted);
|
||||||
page3->load(QUrl("qrc:autotests/data/basic_page.html"));
|
page3->load(QUrl(QSL("qrc:autotests/data/basic_page.html")));
|
||||||
QVERIFY(page3LoadStart.wait());
|
QVERIFY(page3LoadStart.wait());
|
||||||
|
|
||||||
view2.setPage(new QWebEnginePage(&view2));
|
view2.setPage(new QWebEnginePage(&view2));
|
||||||
|
4
src/lib/3rdparty/fancytabwidget.cpp
vendored
4
src/lib/3rdparty/fancytabwidget.cpp
vendored
@ -619,7 +619,7 @@ void FancyTabWidget::SetMode(FancyTabWidget::Mode mode)
|
|||||||
side_layout_->insertWidget(0, bar);
|
side_layout_->insertWidget(0, bar);
|
||||||
tab_bar_ = bar;
|
tab_bar_ = bar;
|
||||||
|
|
||||||
foreach (const Item &item, items_) {
|
for (const Item &item : std::as_const(items_)) {
|
||||||
if (item.type_ == Item::Type_Spacer) {
|
if (item.type_ == Item::Type_Spacer) {
|
||||||
bar->addSpacer(item.spacer_size_);
|
bar->addSpacer(item.spacer_size_);
|
||||||
}
|
}
|
||||||
@ -718,7 +718,7 @@ void FancyTabWidget::MakeTabBar(QTabBar::Shape shape, bool text, bool icons,
|
|||||||
side_layout_->insertWidget(0, bar);
|
side_layout_->insertWidget(0, bar);
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (const Item &item, items_) {
|
for (const Item &item : std::as_const(items_)) {
|
||||||
if (item.type_ != Item::Type_Tab) {
|
if (item.type_ != Item::Type_Tab) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
2
src/lib/3rdparty/lineedit.cpp
vendored
2
src/lib/3rdparty/lineedit.cpp
vendored
@ -302,7 +302,7 @@ void LineEdit::setTextFormat(const LineEdit::TextFormat &format)
|
|||||||
{
|
{
|
||||||
QList<QInputMethodEvent::Attribute> attributes;
|
QList<QInputMethodEvent::Attribute> attributes;
|
||||||
|
|
||||||
foreach (const QTextLayout::FormatRange &fr, format) {
|
for (const QTextLayout::FormatRange &fr : format) {
|
||||||
QInputMethodEvent::AttributeType type = QInputMethodEvent::TextFormat;
|
QInputMethodEvent::AttributeType type = QInputMethodEvent::TextFormat;
|
||||||
int start = fr.start - cursorPosition();
|
int start = fr.start - cursorPosition();
|
||||||
int length = fr.length;
|
int length = fr.length;
|
||||||
|
@ -111,7 +111,7 @@ QtLocalPeer::QtLocalPeer(QObject* parent, const QString &appId)
|
|||||||
#endif
|
#endif
|
||||||
prefix = id.section(QLatin1Char('/'), -1);
|
prefix = id.section(QLatin1Char('/'), -1);
|
||||||
}
|
}
|
||||||
prefix = QRegExp("[^a-zA-Z]").removeIn(prefix);
|
prefix = QRegExp(QStringLiteral("[^a-zA-Z]")).removeIn(prefix);
|
||||||
prefix.truncate(6);
|
prefix.truncate(6);
|
||||||
|
|
||||||
QByteArray idc = id.toUtf8();
|
QByteArray idc = id.toUtf8();
|
||||||
|
@ -190,7 +190,7 @@ bool QtLockedFile::unlock()
|
|||||||
rmutex = 0;
|
rmutex = 0;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
foreach(Qt::HANDLE mutex, rmutexes) {
|
for (Qt::HANDLE mutex : std::as_const(rmutexes)) {
|
||||||
ReleaseMutex(mutex);
|
ReleaseMutex(mutex);
|
||||||
CloseHandle(mutex);
|
CloseHandle(mutex);
|
||||||
}
|
}
|
||||||
|
4
src/lib/3rdparty/stylehelper.cpp
vendored
4
src/lib/3rdparty/stylehelper.cpp
vendored
@ -127,7 +127,9 @@ void StyleHelper::setBaseColor(const QColor &newcolor)
|
|||||||
|
|
||||||
if (color.isValid() && color != m_baseColor) {
|
if (color.isValid() && color != m_baseColor) {
|
||||||
m_baseColor = color;
|
m_baseColor = color;
|
||||||
foreach (QWidget* w, QApplication::topLevelWidgets()) {
|
|
||||||
|
auto const l_topLevelWidgets = QApplication::topLevelWidgets();
|
||||||
|
for (QWidget* w : l_topLevelWidgets) {
|
||||||
w->update();
|
w->update();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -111,7 +111,7 @@ bool AdBlockManager::block(QWebEngineUrlRequestInfo &request, QString &ruleFilte
|
|||||||
QElapsedTimer timer;
|
QElapsedTimer timer;
|
||||||
timer.start();
|
timer.start();
|
||||||
#endif
|
#endif
|
||||||
const QString urlString = request.requestUrl().toEncoded().toLower();
|
const QString urlString = QString::fromUtf8(request.requestUrl().toEncoded().toLower());
|
||||||
const QString urlDomain = request.requestUrl().host().toLower();
|
const QString urlDomain = request.requestUrl().host().toLower();
|
||||||
const QString urlScheme = request.requestUrl().scheme().toLower();
|
const QString urlScheme = request.requestUrl().scheme().toLower();
|
||||||
|
|
||||||
|
@ -76,7 +76,7 @@ static QString getTopLevelDomain(const QUrl &url)
|
|||||||
|
|
||||||
//return qt_ACE_do(tld, ToAceOnly, AllowLeadingDot, {});
|
//return qt_ACE_do(tld, ToAceOnly, AllowLeadingDot, {});
|
||||||
// TODO QT6 - QUrl::toAce() uses ForbidLeadingDot, while the old QUrl::topLevelDomain() used AllowLeadingDot. Does this matter?
|
// TODO QT6 - QUrl::toAce() uses ForbidLeadingDot, while the old QUrl::topLevelDomain() used AllowLeadingDot. Does this matter?
|
||||||
return QString(QUrl::toAce(tld));
|
return QString(QString::fromUtf8(QUrl::toAce(tld)));
|
||||||
}
|
}
|
||||||
|
|
||||||
static QString toSecondLevelDomain(const QUrl &url)
|
static QString toSecondLevelDomain(const QUrl &url)
|
||||||
@ -235,7 +235,7 @@ bool AdBlockRule::urlMatch(const QUrl &url) const
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
const QString encodedUrl = url.toEncoded();
|
const QString encodedUrl = QString::fromUtf8(url.toEncoded());
|
||||||
const QString domain = url.host();
|
const QString domain = url.host();
|
||||||
|
|
||||||
return stringMatch(domain, encodedUrl);
|
return stringMatch(domain, encodedUrl);
|
||||||
|
@ -121,7 +121,7 @@ MainApplication::MainApplication(int &argc, char** argv)
|
|||||||
setDesktopFileName(QSL("org.kde.falkon"));
|
setDesktopFileName(QSL("org.kde.falkon"));
|
||||||
|
|
||||||
#ifdef GIT_REVISION
|
#ifdef GIT_REVISION
|
||||||
setApplicationVersion(QSL("%1 (%2)").arg(Qz::VERSION, GIT_REVISION));
|
setApplicationVersion(QSL("%1 (%2)").arg(QString::fromLatin1(Qz::VERSION), GIT_REVISION));
|
||||||
#else
|
#else
|
||||||
setApplicationVersion(QString::fromLatin1(Qz::VERSION));
|
setApplicationVersion(QString::fromLatin1(Qz::VERSION));
|
||||||
#endif
|
#endif
|
||||||
@ -196,15 +196,15 @@ MainApplication::MainApplication(int &argc, char** argv)
|
|||||||
break;
|
break;
|
||||||
case Qz::CL_OpenUrlInCurrentTab:
|
case Qz::CL_OpenUrlInCurrentTab:
|
||||||
startUrl = QUrl::fromUserInput(pair.text);
|
startUrl = QUrl::fromUserInput(pair.text);
|
||||||
messages.append("ACTION:OpenUrlInCurrentTab" + pair.text);
|
messages.append(QSL("ACTION:OpenUrlInCurrentTab") + pair.text);
|
||||||
break;
|
break;
|
||||||
case Qz::CL_OpenUrlInNewWindow:
|
case Qz::CL_OpenUrlInNewWindow:
|
||||||
startUrl = QUrl::fromUserInput(pair.text);
|
startUrl = QUrl::fromUserInput(pair.text);
|
||||||
messages.append("ACTION:OpenUrlInNewWindow" + pair.text);
|
messages.append(QSL("ACTION:OpenUrlInNewWindow") + pair.text);
|
||||||
break;
|
break;
|
||||||
case Qz::CL_OpenUrl:
|
case Qz::CL_OpenUrl:
|
||||||
startUrl = QUrl::fromUserInput(pair.text);
|
startUrl = QUrl::fromUserInput(pair.text);
|
||||||
messages.append("URL:" + pair.text);
|
messages.append(QSL("URL:") + pair.text);
|
||||||
break;
|
break;
|
||||||
case Qz::CL_ExitAction:
|
case Qz::CL_ExitAction:
|
||||||
m_isClosing = true;
|
m_isClosing = true;
|
||||||
@ -703,7 +703,7 @@ void MainApplication::startPrivateBrowsing(const QUrl &startUrl)
|
|||||||
args.append(QSL("--profile=") + ProfileManager::currentProfile());
|
args.append(QSL("--profile=") + ProfileManager::currentProfile());
|
||||||
|
|
||||||
if (!url.isEmpty()) {
|
if (!url.isEmpty()) {
|
||||||
args << url.toEncoded();
|
args << QString::fromUtf8(url.toEncoded());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!QProcess::startDetached(applicationFilePath(), args)) {
|
if (!QProcess::startDetached(applicationFilePath(), args)) {
|
||||||
@ -1220,7 +1220,7 @@ void MainApplication::createJumpList()
|
|||||||
frequent->setVisible(true);
|
frequent->setVisible(true);
|
||||||
const QVector<HistoryEntry> mostList = m_history->mostVisited(7);
|
const QVector<HistoryEntry> mostList = m_history->mostVisited(7);
|
||||||
for (const HistoryEntry &entry : mostList) {
|
for (const HistoryEntry &entry : mostList) {
|
||||||
frequent->addLink(IconProvider::iconForUrl(entry.url), entry.title, applicationFilePath(), QStringList{entry.url.toEncoded()});
|
frequent->addLink(IconProvider::iconForUrl(entry.url), entry.title, applicationFilePath(), QStringList{(QString::fromUtf8entry.url.toEncoded())});
|
||||||
}
|
}
|
||||||
|
|
||||||
// Tasks
|
// Tasks
|
||||||
@ -1244,14 +1244,14 @@ RegisterQAppAssociation* MainApplication::associationManager()
|
|||||||
{
|
{
|
||||||
if (!m_registerQAppAssociation) {
|
if (!m_registerQAppAssociation) {
|
||||||
QString desc = tr("Falkon is a new and very fast Qt web browser. Falkon is licensed under GPL version 3 or (at your option) any later version. It is based on QtWebEngine and Qt Framework.");
|
QString desc = tr("Falkon is a new and very fast Qt web browser. Falkon is licensed under GPL version 3 or (at your option) any later version. It is based on QtWebEngine and Qt Framework.");
|
||||||
QString fileIconPath = QApplication::applicationFilePath() + ",1";
|
QString fileIconPath = QApplication::applicationFilePath() + QSL(",1");
|
||||||
QString appIconPath = QApplication::applicationFilePath() + ",0";
|
QString appIconPath = QApplication::applicationFilePath() + QSL(",0");
|
||||||
m_registerQAppAssociation = new RegisterQAppAssociation("Falkon", QApplication::applicationFilePath(), appIconPath, desc, this);
|
m_registerQAppAssociation = new RegisterQAppAssociation(QSL("Falkon"), QApplication::applicationFilePath(), appIconPath, desc, this);
|
||||||
m_registerQAppAssociation->addCapability(".html", "FalkonHTML", "Falkon HTML Document", fileIconPath, RegisterQAppAssociation::FileAssociation);
|
m_registerQAppAssociation->addCapability(QSL(".html"), QSL("FalkonHTML"), QSL("Falkon HTML Document"), fileIconPath, RegisterQAppAssociation::FileAssociation);
|
||||||
m_registerQAppAssociation->addCapability(".htm", "FalkonHTML", "Falkon HTML Document", fileIconPath, RegisterQAppAssociation::FileAssociation);
|
m_registerQAppAssociation->addCapability(QSL(".htm"), QSL("FalkonHTML"), QSL("Falkon HTML Document"), fileIconPath, RegisterQAppAssociation::FileAssociation);
|
||||||
m_registerQAppAssociation->addCapability("http", "FalkonURL", "Falkon URL", appIconPath, RegisterQAppAssociation::UrlAssociation);
|
m_registerQAppAssociation->addCapability(QSL("http"), QSL("FalkonURL"), QSL("Falkon URL"), appIconPath, RegisterQAppAssociation::UrlAssociation);
|
||||||
m_registerQAppAssociation->addCapability("https", "FalkonURL", "Falkon URL", appIconPath, RegisterQAppAssociation::UrlAssociation);
|
m_registerQAppAssociation->addCapability(QSL("https"), QSL("FalkonURL"), QSL("Falkon URL"), appIconPath, RegisterQAppAssociation::UrlAssociation);
|
||||||
m_registerQAppAssociation->addCapability("ftp", "FalkonURL", "Falkon URL", appIconPath, RegisterQAppAssociation::UrlAssociation);
|
m_registerQAppAssociation->addCapability(QSL("ftp"), QSL("FalkonURL"), QSL("Falkon URL"), appIconPath, RegisterQAppAssociation::UrlAssociation);
|
||||||
}
|
}
|
||||||
return m_registerQAppAssociation;
|
return m_registerQAppAssociation;
|
||||||
}
|
}
|
||||||
|
@ -177,7 +177,7 @@ void MainMenu::savePageAs()
|
|||||||
|
|
||||||
void MainMenu::sendLink()
|
void MainMenu::sendLink()
|
||||||
{
|
{
|
||||||
const QUrl mailUrl = QUrl::fromEncoded("mailto:%20?body=" + QUrl::toPercentEncoding(m_window->weView()->url().toEncoded()) + "&subject=" + QUrl::toPercentEncoding(m_window->weView()->title()));
|
const QUrl mailUrl = QUrl::fromEncoded("mailto:%20?body=" + QUrl::toPercentEncoding(QString::fromUtf8(m_window->weView()->url().toEncoded())) + "&subject=" + QUrl::toPercentEncoding(m_window->weView()->title()));
|
||||||
QDesktopServices::openUrl(mailUrl);
|
QDesktopServices::openUrl(mailUrl);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -166,10 +166,10 @@ void ProfileManager::updateCurrentProfile()
|
|||||||
// If file exists, just update the profile to current version
|
// If file exists, just update the profile to current version
|
||||||
if (versionFile.exists()) {
|
if (versionFile.exists()) {
|
||||||
versionFile.open(QFile::ReadOnly);
|
versionFile.open(QFile::ReadOnly);
|
||||||
QString profileVersion = versionFile.readAll();
|
QString profileVersion = QString::fromUtf8(versionFile.readAll());
|
||||||
versionFile.close();
|
versionFile.close();
|
||||||
|
|
||||||
updateProfile(Qz::VERSION, profileVersion.trimmed());
|
updateProfile(QString::fromLatin1(Qz::VERSION), profileVersion.trimmed());
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
copyDataToProfile();
|
copyDataToProfile();
|
||||||
@ -189,7 +189,7 @@ void ProfileManager::updateProfile(const QString ¤t, const QString &profil
|
|||||||
Updater::Version prof(profile);
|
Updater::Version prof(profile);
|
||||||
|
|
||||||
// Profile is from newer version than running application
|
// Profile is from newer version than running application
|
||||||
if (prof > Updater::Version(Qz::VERSION)) {
|
if (prof > Updater::Version(QString::fromLatin1(Qz::VERSION))) {
|
||||||
// Only copy data when profile is not from development version
|
// Only copy data when profile is not from development version
|
||||||
if (prof.revisionNumber != 99) {
|
if (prof.revisionNumber != 99) {
|
||||||
copyDataToProfile();
|
copyDataToProfile();
|
||||||
@ -247,8 +247,8 @@ void ProfileManager::copyDataToProfile()
|
|||||||
sessionFile.remove();
|
sessionFile.remove();
|
||||||
}
|
}
|
||||||
|
|
||||||
const QString text = "Incompatible profile version has been detected. To avoid losing your profile data, they were "
|
const QString text = QSL("Incompatible profile version has been detected. To avoid losing your profile data, they were "
|
||||||
"backed up in following file:<br/><br/><b>" + browseDataBackup + "<br/></b>";
|
"backed up in following file:<br/><br/><b>") + browseDataBackup + QSL("<br/></b>");
|
||||||
QMessageBox::warning(0, QStringLiteral("Falkon: Incompatible profile version"), text);
|
QMessageBox::warning(0, QStringLiteral("Falkon: Incompatible profile version"), text);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
#include <QSqlQuery>
|
#include <QSqlQuery>
|
||||||
#include <QSqlDatabase>
|
#include <QSqlDatabase>
|
||||||
|
|
||||||
#define CONNECTION "firefox-places-import"
|
#define CONNECTION QSL("firefox-places-import")
|
||||||
|
|
||||||
FirefoxImporter::FirefoxImporter(QObject* parent)
|
FirefoxImporter::FirefoxImporter(QObject* parent)
|
||||||
: BookmarksImporter(parent)
|
: BookmarksImporter(parent)
|
||||||
|
@ -246,7 +246,7 @@ void BookmarksManager::updateEditBox(BookmarkItem* item)
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
ui->title->setText(item->title());
|
ui->title->setText(item->title());
|
||||||
ui->address->setText(item->url().toEncoded());
|
ui->address->setText(QString::fromUtf8(item->url().toEncoded()));
|
||||||
ui->keyword->setText(item->keyword());
|
ui->keyword->setText(item->keyword());
|
||||||
ui->description->setPlainText(item->description());
|
ui->description->setPlainText(item->description());
|
||||||
|
|
||||||
|
@ -165,9 +165,9 @@ void BookmarksMenu::init()
|
|||||||
{
|
{
|
||||||
setTitle(tr("&Bookmarks"));
|
setTitle(tr("&Bookmarks"));
|
||||||
|
|
||||||
addAction(tr("Bookmark &This Page"), this, &BookmarksMenu::bookmarkPage)->setShortcut(QKeySequence("Ctrl+D"));
|
addAction(tr("Bookmark &This Page"), this, &BookmarksMenu::bookmarkPage)->setShortcut(QKeySequence(QSL("Ctrl+D")));
|
||||||
addAction(tr("Bookmark &All Tabs"), this, &BookmarksMenu::bookmarkAllTabs);
|
addAction(tr("Bookmark &All Tabs"), this, &BookmarksMenu::bookmarkAllTabs);
|
||||||
addAction(QIcon::fromTheme("bookmarks-organize"), tr("Organize &Bookmarks"), this, &BookmarksMenu::showBookmarksManager)->setShortcut(QKeySequence("Ctrl+Shift+O"));
|
addAction(QIcon::fromTheme(QSL("bookmarks-organize")), tr("Organize &Bookmarks"), this, &BookmarksMenu::showBookmarksManager)->setShortcut(QKeySequence(QSL("Ctrl+Shift+O")));
|
||||||
addSeparator();
|
addSeparator();
|
||||||
|
|
||||||
connect(this, SIGNAL(aboutToShow()), this, SLOT(aboutToShow()));
|
connect(this, SIGNAL(aboutToShow()), this, SLOT(aboutToShow()));
|
||||||
|
@ -118,7 +118,7 @@ QVariant BookmarksModel::data(const QModelIndex &index, int role) const
|
|||||||
return itm->isSidebarExpanded();
|
return itm->isSidebarExpanded();
|
||||||
case Qt::ToolTipRole:
|
case Qt::ToolTipRole:
|
||||||
if (index.column() == 0 && itm->isUrl()) {
|
if (index.column() == 0 && itm->isUrl()) {
|
||||||
return QString("%1\n%2").arg(itm->title(), QString::fromUtf8(itm->url().toEncoded()));
|
return QSL("%1\n%2").arg(itm->title(), QString::fromUtf8(itm->url().toEncoded()));
|
||||||
}
|
}
|
||||||
// fallthrough
|
// fallthrough
|
||||||
case Qt::DisplayRole:
|
case Qt::DisplayRole:
|
||||||
@ -126,7 +126,7 @@ QVariant BookmarksModel::data(const QModelIndex &index, int role) const
|
|||||||
case 0:
|
case 0:
|
||||||
return itm->title();
|
return itm->title();
|
||||||
case 1:
|
case 1:
|
||||||
return itm->url().toEncoded();
|
return QString::fromUtf8(itm->url().toEncoded());
|
||||||
default:
|
default:
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
@ -75,9 +75,9 @@ void BookmarksToolbar::contextMenuRequested(const QPoint &pos)
|
|||||||
QAction* actNewWindow = menu.addAction(IconProvider::newWindowIcon(), tr("Open in new window"));
|
QAction* actNewWindow = menu.addAction(IconProvider::newWindowIcon(), tr("Open in new window"));
|
||||||
QAction* actNewPrivateWindow = menu.addAction(IconProvider::privateBrowsingIcon(), tr("Open in new private window"));
|
QAction* actNewPrivateWindow = menu.addAction(IconProvider::privateBrowsingIcon(), tr("Open in new private window"));
|
||||||
menu.addSeparator();
|
menu.addSeparator();
|
||||||
QAction* actNewFolder = menu.addAction(QIcon::fromTheme("folder-new"), tr("New Folder"));
|
QAction* actNewFolder = menu.addAction(QIcon::fromTheme(QSL("folder-new")), tr("New Folder"));
|
||||||
QAction* actEdit = menu.addAction(tr("Edit"));
|
QAction* actEdit = menu.addAction(tr("Edit"));
|
||||||
QAction* actDelete = menu.addAction(QIcon::fromTheme("edit-delete"), tr("Delete"));
|
QAction* actDelete = menu.addAction(QIcon::fromTheme(QSL("edit-delete")), tr("Delete"));
|
||||||
menu.addSeparator();
|
menu.addSeparator();
|
||||||
m_actShowOnlyIcons = menu.addAction(tr("Show Only Icons"));
|
m_actShowOnlyIcons = menu.addAction(tr("Show Only Icons"));
|
||||||
m_actShowOnlyIcons->setCheckable(true);
|
m_actShowOnlyIcons->setCheckable(true);
|
||||||
@ -276,7 +276,7 @@ void BookmarksToolbar::dropEvent(QDropEvent* e)
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
const QUrl url = mime->urls().at(0);
|
const QUrl url = mime->urls().at(0);
|
||||||
const QString title = mime->hasText() ? mime->text() : url.toEncoded(QUrl::RemoveScheme);
|
const QString title = mime->hasText() ? mime->text() : QString::fromUtf8(url.toEncoded(QUrl::RemoveScheme));
|
||||||
|
|
||||||
bookmark = new BookmarkItem(BookmarkItem::Url);
|
bookmark = new BookmarkItem(BookmarkItem::Url);
|
||||||
bookmark->setTitle(title);
|
bookmark->setTitle(title);
|
||||||
|
@ -240,13 +240,13 @@ QString BookmarksToolbarButton::createTooltip() const
|
|||||||
{
|
{
|
||||||
if (!m_bookmark->description().isEmpty()) {
|
if (!m_bookmark->description().isEmpty()) {
|
||||||
if (!m_bookmark->urlString().isEmpty()) {
|
if (!m_bookmark->urlString().isEmpty()) {
|
||||||
return QString("%1\n%2").arg(m_bookmark->description(), m_bookmark->urlString());
|
return QSL("%1\n%2").arg(m_bookmark->description(), m_bookmark->urlString());
|
||||||
}
|
}
|
||||||
return m_bookmark->description();
|
return m_bookmark->description();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!m_bookmark->title().isEmpty() && !m_bookmark->url().isEmpty()) {
|
if (!m_bookmark->title().isEmpty() && !m_bookmark->url().isEmpty()) {
|
||||||
return QString("%1\n%2").arg(m_bookmark->title(), m_bookmark->urlString());
|
return QSL("%1\n%2").arg(m_bookmark->title(), m_bookmark->urlString());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!m_bookmark->title().isEmpty()) {
|
if (!m_bookmark->title().isEmpty()) {
|
||||||
@ -434,7 +434,7 @@ void BookmarksToolbarButton::dropEvent(QDropEvent *event)
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
const QUrl url = mime->urls().at(0);
|
const QUrl url = mime->urls().at(0);
|
||||||
const QString title = mime->hasText() ? mime->text() : url.toEncoded(QUrl::RemoveScheme);
|
const QString title = mime->hasText() ? mime->text() : QString::fromUtf8(url.toEncoded(QUrl::RemoveScheme));
|
||||||
|
|
||||||
bookmark = new BookmarkItem(BookmarkItem::Url);
|
bookmark = new BookmarkItem(BookmarkItem::Url);
|
||||||
bookmark->setTitle(title);
|
bookmark->setTitle(title);
|
||||||
|
@ -444,7 +444,7 @@ void BookmarksTools::addFolderContentsToMenu(QObject *receiver, Menu *menu, Book
|
|||||||
bool BookmarksTools::migrateBookmarksIfNecessary(Bookmarks* bookmarks)
|
bool BookmarksTools::migrateBookmarksIfNecessary(Bookmarks* bookmarks)
|
||||||
{
|
{
|
||||||
QSqlQuery query(SqlDatabase::instance()->database());
|
QSqlQuery query(SqlDatabase::instance()->database());
|
||||||
query.exec("SELECT name FROM sqlite_master WHERE type='table' AND name='folders'");
|
query.exec(QSL("SELECT name FROM sqlite_master WHERE type='table' AND name='folders'"));
|
||||||
|
|
||||||
if (!query.next()) {
|
if (!query.next()) {
|
||||||
return false;
|
return false;
|
||||||
@ -453,11 +453,11 @@ bool BookmarksTools::migrateBookmarksIfNecessary(Bookmarks* bookmarks)
|
|||||||
std::cout << "Bookmarks: Migrating your bookmarks from SQLite to JSON..." << std::endl;
|
std::cout << "Bookmarks: Migrating your bookmarks from SQLite to JSON..." << std::endl;
|
||||||
|
|
||||||
QHash<QString, BookmarkItem*> folders;
|
QHash<QString, BookmarkItem*> folders;
|
||||||
folders.insert("bookmarksToolbar", bookmarks->toolbarFolder());
|
folders.insert(QSL("bookmarksToolbar"), bookmarks->toolbarFolder());
|
||||||
folders.insert("bookmarksMenu", bookmarks->menuFolder());
|
folders.insert(QSL("bookmarksMenu"), bookmarks->menuFolder());
|
||||||
folders.insert("unsorted", bookmarks->unsortedFolder());
|
folders.insert(QSL("unsorted"), bookmarks->unsortedFolder());
|
||||||
|
|
||||||
query.exec("SELECT name, subfolder FROM folders");
|
query.exec(QSL("SELECT name, subfolder FROM folders"));
|
||||||
while (query.next()) {
|
while (query.next()) {
|
||||||
const QString title = query.value(0).toString();
|
const QString title = query.value(0).toString();
|
||||||
bool subfolder = query.value(1).toString() == QLatin1String("yes");
|
bool subfolder = query.value(1).toString() == QLatin1String("yes");
|
||||||
@ -468,7 +468,7 @@ bool BookmarksTools::migrateBookmarksIfNecessary(Bookmarks* bookmarks)
|
|||||||
folders.insert(folder->title(), folder);
|
folders.insert(folder->title(), folder);
|
||||||
}
|
}
|
||||||
|
|
||||||
query.exec("SELECT title, folder, url FROM bookmarks ORDER BY position ASC");
|
query.exec(QSL("SELECT title, folder, url FROM bookmarks ORDER BY position ASC"));
|
||||||
while (query.next()) {
|
while (query.next()) {
|
||||||
const QString title = query.value(0).toString();
|
const QString title = query.value(0).toString();
|
||||||
const QString folder = query.value(1).toString();
|
const QString folder = query.value(1).toString();
|
||||||
@ -485,9 +485,9 @@ bool BookmarksTools::migrateBookmarksIfNecessary(Bookmarks* bookmarks)
|
|||||||
bookmark->setUrl(url);
|
bookmark->setUrl(url);
|
||||||
}
|
}
|
||||||
|
|
||||||
query.exec("DROP TABLE folders");
|
query.exec(QSL("DROP TABLE folders"));
|
||||||
query.exec("DROP TABLE bookmarks");
|
query.exec(QSL("DROP TABLE bookmarks"));
|
||||||
query.exec("VACUUM");
|
query.exec(QSL("VACUUM"));
|
||||||
|
|
||||||
std::cout << "Bookmarks: Bookmarks successfully migrated!" << std::endl;
|
std::cout << "Bookmarks: Bookmarks successfully migrated!" << std::endl;
|
||||||
return true;
|
return true;
|
||||||
|
@ -50,12 +50,12 @@ CookieJar::~CookieJar()
|
|||||||
void CookieJar::loadSettings()
|
void CookieJar::loadSettings()
|
||||||
{
|
{
|
||||||
Settings settings;
|
Settings settings;
|
||||||
settings.beginGroup("Cookie-Settings");
|
settings.beginGroup(QSL("Cookie-Settings"));
|
||||||
m_allowCookies = settings.value("allowCookies", true).toBool();
|
m_allowCookies = settings.value(QSL("allowCookies"), true).toBool();
|
||||||
m_filterThirdParty = settings.value("filterThirdPartyCookies", false).toBool();
|
m_filterThirdParty = settings.value(QSL("filterThirdPartyCookies"), false).toBool();
|
||||||
m_filterTrackingCookie = settings.value("filterTrackingCookie", false).toBool();
|
m_filterTrackingCookie = settings.value(QSL("filterTrackingCookie"), false).toBool();
|
||||||
m_whitelist = settings.value("whitelist", QStringList()).toStringList();
|
m_whitelist = settings.value(QSL("whitelist"), QStringList()).toStringList();
|
||||||
m_blacklist = settings.value("blacklist", QStringList()).toStringList();
|
m_blacklist = settings.value(QSL("blacklist"), QStringList()).toStringList();
|
||||||
settings.endGroup();
|
settings.endGroup();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -66,13 +66,13 @@ CookieManager::CookieManager(QWidget *parent)
|
|||||||
|
|
||||||
// Cookie Settings
|
// Cookie Settings
|
||||||
Settings settings;
|
Settings settings;
|
||||||
settings.beginGroup("Cookie-Settings");
|
settings.beginGroup(QSL("Cookie-Settings"));
|
||||||
ui->saveCookies->setChecked(settings.value("allowCookies", true).toBool());
|
ui->saveCookies->setChecked(settings.value(QSL("allowCookies"), true).toBool());
|
||||||
ui->filter3rdParty->setChecked(settings.value("filterThirdPartyCookies", false).toBool());
|
ui->filter3rdParty->setChecked(settings.value(QSL("filterThirdPartyCookies"), false).toBool());
|
||||||
ui->filterTracking->setChecked(settings.value("filterTrackingCookie", false).toBool());
|
ui->filterTracking->setChecked(settings.value(QSL("filterTrackingCookie"), false).toBool());
|
||||||
ui->deleteCookiesOnClose->setChecked(settings.value("deleteCookiesOnClose", false).toBool());
|
ui->deleteCookiesOnClose->setChecked(settings.value(QSL("deleteCookiesOnClose"), false).toBool());
|
||||||
ui->whiteList->addItems(settings.value("whitelist", QStringList()).toStringList());
|
ui->whiteList->addItems(settings.value(QSL("whitelist"), QStringList()).toStringList());
|
||||||
ui->blackList->addItems(settings.value("blacklist", QStringList()).toStringList());
|
ui->blackList->addItems(settings.value(QSL("blacklist"), QStringList()).toStringList());
|
||||||
settings.endGroup();
|
settings.endGroup();
|
||||||
|
|
||||||
ui->search->setPlaceholderText(tr("Search"));
|
ui->search->setPlaceholderText(tr("Search"));
|
||||||
@ -84,7 +84,7 @@ CookieManager::CookieManager(QWidget *parent)
|
|||||||
ui->whiteList->sortItems(Qt::AscendingOrder);
|
ui->whiteList->sortItems(Qt::AscendingOrder);
|
||||||
ui->blackList->sortItems(Qt::AscendingOrder);
|
ui->blackList->sortItems(Qt::AscendingOrder);
|
||||||
|
|
||||||
auto* removeShortcut = new QShortcut(QKeySequence("Del"), this);
|
auto* removeShortcut = new QShortcut(QKeySequence(QSL("Del")), this);
|
||||||
connect(removeShortcut, &QShortcut::activated, this, &CookieManager::deletePressed);
|
connect(removeShortcut, &QShortcut::activated, this, &CookieManager::deletePressed);
|
||||||
|
|
||||||
connect(ui->search, &QLineEdit::textChanged, this, &CookieManager::filterString);
|
connect(ui->search, &QLineEdit::textChanged, this, &CookieManager::filterString);
|
||||||
@ -97,7 +97,7 @@ CookieManager::CookieManager(QWidget *parent)
|
|||||||
addCookie(cookie);
|
addCookie(cookie);
|
||||||
}
|
}
|
||||||
|
|
||||||
QzTools::setWmClass("Cookies", this);
|
QzTools::setWmClass(QSL("Cookies"), this);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CookieManager::removeAll()
|
void CookieManager::removeAll()
|
||||||
@ -171,12 +171,12 @@ void CookieManager::currentItemChanged(QTreeWidgetItem* current, QTreeWidgetItem
|
|||||||
|
|
||||||
const QNetworkCookie cookie = qvariant_cast<QNetworkCookie>(current->data(0, Qt::UserRole + 10));
|
const QNetworkCookie cookie = qvariant_cast<QNetworkCookie>(current->data(0, Qt::UserRole + 10));
|
||||||
|
|
||||||
ui->name->setText(cookie.name());
|
ui->name->setText(QString::fromUtf8(cookie.name()));
|
||||||
ui->value->setText(cookie.value());
|
ui->value->setText(QString::fromUtf8(cookie.value()));
|
||||||
ui->server->setText(cookie.domain());
|
ui->server->setText(cookie.domain());
|
||||||
ui->path->setText(cookie.path());
|
ui->path->setText(cookie.path());
|
||||||
cookie.isSecure() ? ui->secure->setText(tr("Secure only")) : ui->secure->setText(tr("All connections"));
|
cookie.isSecure() ? ui->secure->setText(tr("Secure only")) : ui->secure->setText(tr("All connections"));
|
||||||
cookie.isSessionCookie() ? ui->expiration->setText(tr("Session cookie")) : ui->expiration->setText(QDateTime(cookie.expirationDate()).toString("hh:mm:ss dddd d. MMMM yyyy"));
|
cookie.isSessionCookie() ? ui->expiration->setText(tr("Session cookie")) : ui->expiration->setText(QDateTime(cookie.expirationDate()).toString(QSL("hh:mm:ss dddd d. MMMM yyyy")));
|
||||||
|
|
||||||
ui->removeOne->setText(tr("Remove cookie"));
|
ui->removeOne->setText(tr("Remove cookie"));
|
||||||
}
|
}
|
||||||
@ -274,7 +274,7 @@ void CookieManager::filterString(const QString &string)
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
for (int i = 0; i < ui->cookieTree->topLevelItemCount(); ++i) {
|
for (int i = 0; i < ui->cookieTree->topLevelItemCount(); ++i) {
|
||||||
QString text = "." + ui->cookieTree->topLevelItem(i)->text(0);
|
QString text = QSL(".") + ui->cookieTree->topLevelItem(i)->text(0);
|
||||||
ui->cookieTree->topLevelItem(i)->setHidden(!text.contains(string, Qt::CaseInsensitive));
|
ui->cookieTree->topLevelItem(i)->setHidden(!text.contains(string, Qt::CaseInsensitive));
|
||||||
ui->cookieTree->topLevelItem(i)->setExpanded(true);
|
ui->cookieTree->topLevelItem(i)->setExpanded(true);
|
||||||
}
|
}
|
||||||
@ -301,8 +301,8 @@ void CookieManager::addCookie(const QNetworkCookie &cookie)
|
|||||||
item = new QTreeWidgetItem(newParent);
|
item = new QTreeWidgetItem(newParent);
|
||||||
}
|
}
|
||||||
|
|
||||||
item->setText(0, "." + domain);
|
item->setText(0, QSL(".") + domain);
|
||||||
item->setText(1, cookie.name());
|
item->setText(1, QString::fromUtf8(cookie.name()));
|
||||||
item->setData(0, Qt::UserRole + 10, QVariant::fromValue(cookie));
|
item->setData(0, Qt::UserRole + 10, QVariant::fromValue(cookie));
|
||||||
ui->cookieTree->addTopLevelItem(item);
|
ui->cookieTree->addTopLevelItem(item);
|
||||||
|
|
||||||
@ -340,13 +340,13 @@ void CookieManager::closeEvent(QCloseEvent* e)
|
|||||||
}
|
}
|
||||||
|
|
||||||
Settings settings;
|
Settings settings;
|
||||||
settings.beginGroup("Cookie-Settings");
|
settings.beginGroup(QSL("Cookie-Settings"));
|
||||||
settings.setValue("allowCookies", ui->saveCookies->isChecked());
|
settings.setValue(QSL("allowCookies"), ui->saveCookies->isChecked());
|
||||||
settings.setValue("filterThirdPartyCookies", ui->filter3rdParty->isChecked());
|
settings.setValue(QSL("filterThirdPartyCookies"), ui->filter3rdParty->isChecked());
|
||||||
settings.setValue("filterTrackingCookie", ui->filterTracking->isChecked());
|
settings.setValue(QSL("filterTrackingCookie"), ui->filterTracking->isChecked());
|
||||||
settings.setValue("deleteCookiesOnClose", ui->deleteCookiesOnClose->isChecked());
|
settings.setValue(QSL("deleteCookiesOnClose"), ui->deleteCookiesOnClose->isChecked());
|
||||||
settings.setValue("whitelist", whitelist);
|
settings.setValue(QSL("whitelist"), whitelist);
|
||||||
settings.setValue("blacklist", blacklist);
|
settings.setValue(QSL("blacklist"), blacklist);
|
||||||
settings.endGroup();
|
settings.endGroup();
|
||||||
|
|
||||||
mApp->cookieJar()->loadSettings();
|
mApp->cookieJar()->loadSettings();
|
||||||
|
@ -175,7 +175,7 @@ void DownloadItem::receivedOrTotalBytesChanged()
|
|||||||
m_total = total;
|
m_total = total;
|
||||||
|
|
||||||
updateDownloadInfo(m_currSpeed, m_received, m_total);
|
updateDownloadInfo(m_currSpeed, m_received, m_total);
|
||||||
emit progressChanged(m_currSpeed, m_received, m_total);
|
Q_EMIT progressChanged(m_currSpeed, m_received, m_total);
|
||||||
}
|
}
|
||||||
|
|
||||||
int DownloadItem::progress()
|
int DownloadItem::progress()
|
||||||
@ -304,21 +304,21 @@ void DownloadItem::mouseDoubleClickEvent(QMouseEvent* e)
|
|||||||
void DownloadItem::customContextMenuRequested(const QPoint &pos)
|
void DownloadItem::customContextMenuRequested(const QPoint &pos)
|
||||||
{
|
{
|
||||||
QMenu menu;
|
QMenu menu;
|
||||||
menu.addAction(QIcon::fromTheme("document-open"), tr("Open File"), this, &DownloadItem::openFile);
|
menu.addAction(QIcon::fromTheme(QSL("document-open")), tr("Open File"), this, &DownloadItem::openFile);
|
||||||
|
|
||||||
menu.addAction(tr("Open Folder"), this, &DownloadItem::openFolder);
|
menu.addAction(tr("Open Folder"), this, &DownloadItem::openFolder);
|
||||||
menu.addSeparator();
|
menu.addSeparator();
|
||||||
menu.addAction(QIcon::fromTheme("edit-copy"), tr("Copy Download Link"), this, &DownloadItem::copyDownloadLink);
|
menu.addAction(QIcon::fromTheme(QSL("edit-copy")), tr("Copy Download Link"), this, &DownloadItem::copyDownloadLink);
|
||||||
menu.addSeparator();
|
menu.addSeparator();
|
||||||
menu.addAction(QIcon::fromTheme("process-stop"), tr("Cancel downloading"), this, &DownloadItem::stop)->setEnabled(m_downloading);
|
menu.addAction(QIcon::fromTheme(QSL("process-stop")), tr("Cancel downloading"), this, &DownloadItem::stop)->setEnabled(m_downloading);
|
||||||
|
|
||||||
if (m_download->isPaused()) {
|
if (m_download->isPaused()) {
|
||||||
menu.addAction(QIcon::fromTheme("media-playback-start"), tr("Resume downloading"), this, &DownloadItem::pauseResume)->setEnabled(m_downloading);
|
menu.addAction(QIcon::fromTheme(QSL("media-playback-start")), tr("Resume downloading"), this, &DownloadItem::pauseResume)->setEnabled(m_downloading);
|
||||||
} else {
|
} else {
|
||||||
menu.addAction(QIcon::fromTheme("media-playback-pause"), tr("Pause downloading"), this, &DownloadItem::pauseResume)->setEnabled(m_downloading);
|
menu.addAction(QIcon::fromTheme(QSL("media-playback-pause")), tr("Pause downloading"), this, &DownloadItem::pauseResume)->setEnabled(m_downloading);
|
||||||
}
|
}
|
||||||
|
|
||||||
menu.addAction(QIcon::fromTheme("list-remove"), tr("Remove From List"), this, &DownloadItem::clear)->setEnabled(!m_downloading);
|
menu.addAction(QIcon::fromTheme(QSL("list-remove")), tr("Remove From List"), this, &DownloadItem::clear)->setEnabled(!m_downloading);
|
||||||
|
|
||||||
if (m_downloading || ui->downloadInfo->text().startsWith(tr("Cancelled")) || ui->downloadInfo->text().startsWith(tr("Error"))) {
|
if (m_downloading || ui->downloadInfo->text().startsWith(tr("Cancelled")) || ui->downloadInfo->text().startsWith(tr("Error"))) {
|
||||||
menu.actions().at(0)->setEnabled(false);
|
menu.actions().at(0)->setEnabled(false);
|
||||||
@ -359,8 +359,8 @@ void DownloadItem::openFolder()
|
|||||||
winFileName.append(QSL(".download"));
|
winFileName.append(QSL(".download"));
|
||||||
}
|
}
|
||||||
|
|
||||||
winFileName.replace(QLatin1Char('/'), "\\");
|
winFileName.replace(QLatin1Char('/'), QSL("\\"));
|
||||||
QString shExArg = "/e,/select,\"" + winFileName + "\"";
|
QString shExArg = QSL("/e,/select,\"") + winFileName + QSL("\"");
|
||||||
ShellExecute(NULL, NULL, TEXT("explorer.exe"), shExArg.toStdWString().c_str(), NULL, SW_SHOW);
|
ShellExecute(NULL, NULL, TEXT("explorer.exe"), shExArg.toStdWString().c_str(), NULL, SW_SHOW);
|
||||||
#else
|
#else
|
||||||
QDesktopServices::openUrl(QUrl::fromLocalFile(m_path));
|
QDesktopServices::openUrl(QUrl::fromLocalFile(m_path));
|
||||||
|
@ -64,17 +64,17 @@ DownloadManager::DownloadManager(QWidget* parent)
|
|||||||
QtWin::extendFrameIntoClientArea(this, -1, -1, -1, -1);
|
QtWin::extendFrameIntoClientArea(this, -1, -1, -1, -1);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
ui->clearButton->setIcon(QIcon::fromTheme("edit-clear"));
|
ui->clearButton->setIcon(QIcon::fromTheme(QSL("edit-clear")));
|
||||||
QzTools::centerWidgetOnScreen(this);
|
QzTools::centerWidgetOnScreen(this);
|
||||||
|
|
||||||
connect(ui->clearButton, &QAbstractButton::clicked, this, &DownloadManager::clearList);
|
connect(ui->clearButton, &QAbstractButton::clicked, this, &DownloadManager::clearList);
|
||||||
|
|
||||||
auto* clearShortcut = new QShortcut(QKeySequence("CTRL+L"), this);
|
auto* clearShortcut = new QShortcut(QKeySequence(QSL("CTRL+L")), this);
|
||||||
connect(clearShortcut, &QShortcut::activated, this, &DownloadManager::clearList);
|
connect(clearShortcut, &QShortcut::activated, this, &DownloadManager::clearList);
|
||||||
|
|
||||||
loadSettings();
|
loadSettings();
|
||||||
|
|
||||||
QzTools::setWmClass("Download Manager", this);
|
QzTools::setWmClass(QSL("Download Manager"), this);
|
||||||
|
|
||||||
connect(m_model, &DownloadManagerModel::downloadAdded, this, &DownloadManager::downloadAdded);
|
connect(m_model, &DownloadManagerModel::downloadAdded, this, &DownloadManager::downloadAdded);
|
||||||
}
|
}
|
||||||
@ -82,15 +82,15 @@ DownloadManager::DownloadManager(QWidget* parent)
|
|||||||
void DownloadManager::loadSettings()
|
void DownloadManager::loadSettings()
|
||||||
{
|
{
|
||||||
Settings settings;
|
Settings settings;
|
||||||
settings.beginGroup("DownloadManager");
|
settings.beginGroup(QSL("DownloadManager"));
|
||||||
m_downloadPath = settings.value("defaultDownloadPath", QString()).toString();
|
m_downloadPath = settings.value(QSL("defaultDownloadPath"), QString()).toString();
|
||||||
m_lastDownloadPath = settings.value("lastDownloadPath", QStandardPaths::writableLocation(QStandardPaths::DownloadLocation)).toString();
|
m_lastDownloadPath = settings.value(QSL("lastDownloadPath"), QStandardPaths::writableLocation(QStandardPaths::DownloadLocation)).toString();
|
||||||
m_closeOnFinish = settings.value("CloseManagerOnFinish", false).toBool();
|
m_closeOnFinish = settings.value(QSL("CloseManagerOnFinish"), false).toBool();
|
||||||
m_useNativeDialog = settings.value("useNativeDialog", DEFAULT_DOWNLOAD_USE_NATIVE_DIALOG).toBool();
|
m_useNativeDialog = settings.value(QSL("useNativeDialog"), DEFAULT_DOWNLOAD_USE_NATIVE_DIALOG).toBool();
|
||||||
|
|
||||||
m_useExternalManager = settings.value("UseExternalManager", false).toBool();
|
m_useExternalManager = settings.value(QSL("UseExternalManager"), false).toBool();
|
||||||
m_externalExecutable = settings.value("ExternalManagerExecutable", QString()).toString();
|
m_externalExecutable = settings.value(QSL("ExternalManagerExecutable"), QString()).toString();
|
||||||
m_externalArguments = settings.value("ExternalManagerArguments", QString()).toString();
|
m_externalArguments = settings.value(QSL("ExternalManagerArguments"), QString()).toString();
|
||||||
settings.endGroup();
|
settings.endGroup();
|
||||||
|
|
||||||
if (!m_externalArguments.contains(QLatin1String("%d"))) {
|
if (!m_externalArguments.contains(QLatin1String("%d"))) {
|
||||||
@ -174,7 +174,7 @@ QWinTaskbarButton *DownloadManager::taskbarButton()
|
|||||||
void DownloadManager::startExternalManager(const QUrl &url)
|
void DownloadManager::startExternalManager(const QUrl &url)
|
||||||
{
|
{
|
||||||
QString arguments = m_externalArguments;
|
QString arguments = m_externalArguments;
|
||||||
arguments.replace(QLatin1String("%d"), url.toEncoded());
|
arguments.replace(QLatin1String("%d"), QString::fromUtf8(url.toEncoded()));
|
||||||
|
|
||||||
QzTools::startExternalProcess(m_externalExecutable, arguments);
|
QzTools::startExternalProcess(m_externalExecutable, arguments);
|
||||||
m_lastDownloadOption = ExternalManager;
|
m_lastDownloadOption = ExternalManager;
|
||||||
|
@ -42,14 +42,14 @@ void DownloadManagerModel::addDownload(DownloadItem *item)
|
|||||||
{
|
{
|
||||||
m_downloads.append(item);
|
m_downloads.append(item);
|
||||||
connect(item, &DownloadItem::deleteItem, this, &DownloadManagerModel::removeDownload);
|
connect(item, &DownloadItem::deleteItem, this, &DownloadManagerModel::removeDownload);
|
||||||
emit downloadAdded(item);
|
Q_EMIT downloadAdded(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DownloadManagerModel::removeDownload(DownloadItem *item)
|
void DownloadManagerModel::removeDownload(DownloadItem *item)
|
||||||
{
|
{
|
||||||
if (item && !item->isDownloading()) {
|
if (item && !item->isDownloading()) {
|
||||||
delete item;
|
delete item;
|
||||||
emit downloadRemoved(item);
|
Q_EMIT downloadRemoved(item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -37,7 +37,7 @@ public:
|
|||||||
private:
|
private:
|
||||||
QList<DownloadItem *> m_downloads;
|
QList<DownloadItem *> m_downloads;
|
||||||
|
|
||||||
signals:
|
Q_SIGNALS:
|
||||||
void downloadAdded(DownloadItem *item);
|
void downloadAdded(DownloadItem *item);
|
||||||
void downloadRemoved(DownloadItem *item);
|
void downloadRemoved(DownloadItem *item);
|
||||||
};
|
};
|
||||||
|
@ -31,7 +31,7 @@ DownloadOptionsDialog::DownloadOptionsDialog(const QString &fileName, QWebEngine
|
|||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
|
||||||
ui->fileName->setText("<b>" + fileName + "</b>");
|
ui->fileName->setText(QSL("<b>") + fileName + QSL("</b>"));
|
||||||
ui->fromServer->setText(m_downloadItem->url().host());
|
ui->fromServer->setText(m_downloadItem->url().host());
|
||||||
|
|
||||||
const QIcon fileIcon = IconProvider::instance()->standardIcon(QStyle::SP_FileIcon);
|
const QIcon fileIcon = IconProvider::instance()->standardIcon(QStyle::SP_FileIcon);
|
||||||
|
@ -46,8 +46,8 @@ HistoryModel* History::model()
|
|||||||
void History::loadSettings()
|
void History::loadSettings()
|
||||||
{
|
{
|
||||||
Settings settings;
|
Settings settings;
|
||||||
settings.beginGroup("Web-Browser-Settings");
|
settings.beginGroup(QSL("Web-Browser-Settings"));
|
||||||
m_isSaving = settings.value("allowHistory", true).toBool();
|
m_isSaving = settings.value(QSL("allowHistory"), true).toBool();
|
||||||
settings.endGroup();
|
settings.endGroup();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -96,7 +96,7 @@ void History::addHistoryEntry(const QUrl &url, QString title)
|
|||||||
entry.count = 1;
|
entry.count = 1;
|
||||||
entry.date = QDateTime::currentDateTime();
|
entry.date = QDateTime::currentDateTime();
|
||||||
entry.url = url;
|
entry.url = url;
|
||||||
entry.urlString = url.toEncoded();
|
entry.urlString = QString::fromUtf8(url.toEncoded());
|
||||||
entry.title = title;
|
entry.title = title;
|
||||||
Q_EMIT historyEntryAdded(entry);
|
Q_EMIT historyEntryAdded(entry);
|
||||||
});
|
});
|
||||||
@ -118,7 +118,7 @@ void History::addHistoryEntry(const QUrl &url, QString title)
|
|||||||
before.count = count;
|
before.count = count;
|
||||||
before.date = date;
|
before.date = date;
|
||||||
before.url = url;
|
before.url = url;
|
||||||
before.urlString = url.toEncoded();
|
before.urlString = QString::fromUtf8(url.toEncoded());
|
||||||
before.title = oldTitle;
|
before.title = oldTitle;
|
||||||
|
|
||||||
HistoryEntry after = before;
|
HistoryEntry after = before;
|
||||||
@ -150,7 +150,7 @@ void History::deleteHistoryEntry(const QList<int> &list)
|
|||||||
|
|
||||||
for (int index : list) {
|
for (int index : list) {
|
||||||
QSqlQuery query(SqlDatabase::instance()->database());
|
QSqlQuery query(SqlDatabase::instance()->database());
|
||||||
query.prepare("SELECT count, date, url, title FROM history WHERE id=?");
|
query.prepare(QSL("SELECT count, date, url, title FROM history WHERE id=?"));
|
||||||
query.addBindValue(index);
|
query.addBindValue(index);
|
||||||
query.exec();
|
query.exec();
|
||||||
|
|
||||||
@ -163,14 +163,14 @@ void History::deleteHistoryEntry(const QList<int> &list)
|
|||||||
entry.count = query.value(0).toInt();
|
entry.count = query.value(0).toInt();
|
||||||
entry.date = QDateTime::fromMSecsSinceEpoch(query.value(1).toLongLong());
|
entry.date = QDateTime::fromMSecsSinceEpoch(query.value(1).toLongLong());
|
||||||
entry.url = query.value(2).toUrl();
|
entry.url = query.value(2).toUrl();
|
||||||
entry.urlString = entry.url.toEncoded();
|
entry.urlString = QString::fromUtf8(entry.url.toEncoded());
|
||||||
entry.title = query.value(3).toString();
|
entry.title = query.value(3).toString();
|
||||||
|
|
||||||
query.prepare("DELETE FROM history WHERE id=?");
|
query.prepare(QSL("DELETE FROM history WHERE id=?"));
|
||||||
query.addBindValue(index);
|
query.addBindValue(index);
|
||||||
query.exec();
|
query.exec();
|
||||||
|
|
||||||
query.prepare("DELETE FROM icons WHERE url=?");
|
query.prepare(QSL("DELETE FROM icons WHERE url=?"));
|
||||||
query.addBindValue(entry.url.toEncoded(QUrl::RemoveFragment));
|
query.addBindValue(entry.url.toEncoded(QUrl::RemoveFragment));
|
||||||
query.exec();
|
query.exec();
|
||||||
|
|
||||||
@ -195,7 +195,7 @@ void History::deleteHistoryEntry(const QString &url)
|
|||||||
void History::deleteHistoryEntry(const QString &url, const QString &title)
|
void History::deleteHistoryEntry(const QString &url, const QString &title)
|
||||||
{
|
{
|
||||||
QSqlQuery query(SqlDatabase::instance()->database());
|
QSqlQuery query(SqlDatabase::instance()->database());
|
||||||
query.prepare("SELECT id FROM history WHERE url=? AND title=?");
|
query.prepare(QSL("SELECT id FROM history WHERE url=? AND title=?"));
|
||||||
query.bindValue(0, url);
|
query.bindValue(0, url);
|
||||||
query.bindValue(1, title);
|
query.bindValue(1, title);
|
||||||
query.exec();
|
query.exec();
|
||||||
@ -214,7 +214,7 @@ QList<int> History::indexesFromTimeRange(qint64 start, qint64 end)
|
|||||||
}
|
}
|
||||||
|
|
||||||
QSqlQuery query(SqlDatabase::instance()->database());
|
QSqlQuery query(SqlDatabase::instance()->database());
|
||||||
query.prepare("SELECT id FROM history WHERE date BETWEEN ? AND ?");
|
query.prepare(QSL("SELECT id FROM history WHERE date BETWEEN ? AND ?"));
|
||||||
query.addBindValue(end);
|
query.addBindValue(end);
|
||||||
query.addBindValue(start);
|
query.addBindValue(start);
|
||||||
query.exec();
|
query.exec();
|
||||||
@ -230,7 +230,7 @@ QVector<HistoryEntry> History::mostVisited(int count)
|
|||||||
{
|
{
|
||||||
QVector<HistoryEntry> list;
|
QVector<HistoryEntry> list;
|
||||||
QSqlQuery query(SqlDatabase::instance()->database());
|
QSqlQuery query(SqlDatabase::instance()->database());
|
||||||
query.prepare(QString("SELECT count, date, id, title, url FROM history ORDER BY count DESC LIMIT %1").arg(count));
|
query.prepare(QSL("SELECT count, date, id, title, url FROM history ORDER BY count DESC LIMIT %1").arg(count));
|
||||||
query.exec();
|
query.exec();
|
||||||
while (query.next()) {
|
while (query.next()) {
|
||||||
HistoryEntry entry;
|
HistoryEntry entry;
|
||||||
@ -303,8 +303,8 @@ QList<HistoryEntry> History::searchHistoryEntry(const QString &text)
|
|||||||
QList<HistoryEntry> list;
|
QList<HistoryEntry> list;
|
||||||
QSqlQuery query(SqlDatabase::instance()->database());
|
QSqlQuery query(SqlDatabase::instance()->database());
|
||||||
query.prepare(QSL("SELECT count, date, id, title, url FROM history WHERE title LIKE ? OR url LIKE ?"));
|
query.prepare(QSL("SELECT count, date, id, title, url FROM history WHERE title LIKE ? OR url LIKE ?"));
|
||||||
query.bindValue(0, QString("%%1%").arg(text));
|
query.bindValue(0, QSL("%%1%").arg(text));
|
||||||
query.bindValue(1, QString("%%1%").arg(text));
|
query.bindValue(1, QSL("%%1%").arg(text));
|
||||||
query.exec();
|
query.exec();
|
||||||
while (query.next()) {
|
while (query.next()) {
|
||||||
HistoryEntry entry;
|
HistoryEntry entry;
|
||||||
|
@ -241,10 +241,10 @@ void HistoryMenu::init()
|
|||||||
act = addAction(IconProvider::standardIcon(QStyle::SP_ArrowForward), tr("&Forward"), this, &HistoryMenu::goForward);
|
act = addAction(IconProvider::standardIcon(QStyle::SP_ArrowForward), tr("&Forward"), this, &HistoryMenu::goForward);
|
||||||
act->setShortcut(QzTools::actionShortcut(QKeySequence::Forward, Qt::ALT + Qt::Key_Right, QKeySequence::Back, Qt::ALT + Qt::Key_Left));
|
act->setShortcut(QzTools::actionShortcut(QKeySequence::Forward, Qt::ALT + Qt::Key_Right, QKeySequence::Back, Qt::ALT + Qt::Key_Left));
|
||||||
|
|
||||||
act = addAction(QIcon::fromTheme("go-home"), tr("&Home"), this, &HistoryMenu::goHome);
|
act = addAction(QIcon::fromTheme(QSL("go-home")), tr("&Home"), this, &HistoryMenu::goHome);
|
||||||
act->setShortcut(QKeySequence(Qt::ALT | Qt::Key_Home));
|
act->setShortcut(QKeySequence(Qt::ALT | Qt::Key_Home));
|
||||||
|
|
||||||
act = addAction(QIcon::fromTheme("deep-history", QIcon(":/icons/menu/history.svg")), tr("Show &All History"), this, &HistoryMenu::showHistoryManager);
|
act = addAction(QIcon::fromTheme(QSL("deep-history"), QIcon(QSL(":/icons/menu/history.svg"))), tr("Show &All History"), this, &HistoryMenu::showHistoryManager);
|
||||||
act->setShortcut(QKeySequence(Qt::CTRL | Qt::SHIFT | Qt::Key_H));
|
act->setShortcut(QKeySequence(Qt::CTRL | Qt::SHIFT | Qt::Key_H));
|
||||||
|
|
||||||
addSeparator();
|
addSeparator();
|
||||||
|
@ -29,10 +29,10 @@ static QString dateTimeToString(const QDateTime &dateTime)
|
|||||||
{
|
{
|
||||||
const QDateTime current = QDateTime::currentDateTime();
|
const QDateTime current = QDateTime::currentDateTime();
|
||||||
if (current.date() == dateTime.date()) {
|
if (current.date() == dateTime.date()) {
|
||||||
return dateTime.time().toString("h:mm");
|
return dateTime.time().toString(QSL("h:mm"));
|
||||||
}
|
}
|
||||||
|
|
||||||
return dateTime.toString("d.M.yyyy h:mm");
|
return dateTime.toString(QSL("d.M.yyyy h:mm"));
|
||||||
}
|
}
|
||||||
|
|
||||||
HistoryModel::HistoryModel(History* history)
|
HistoryModel::HistoryModel(History* history)
|
||||||
@ -87,7 +87,7 @@ QVariant HistoryModel::data(const QModelIndex &index, int role) const
|
|||||||
case Qt::EditRole:
|
case Qt::EditRole:
|
||||||
return index.column() == 0 ? item->title : QVariant();
|
return index.column() == 0 ? item->title : QVariant();
|
||||||
case Qt::DecorationRole:
|
case Qt::DecorationRole:
|
||||||
return index.column() == 0 ? QIcon::fromTheme(QSL("view-calendar"), QIcon(":/icons/menu/history_entry.svg")) : QVariant();
|
return index.column() == 0 ? QIcon::fromTheme(QSL("view-calendar"), QIcon(QSL(":/icons/menu/history_entry.svg"))) : QVariant();
|
||||||
}
|
}
|
||||||
|
|
||||||
return {};
|
return {};
|
||||||
@ -114,7 +114,7 @@ QVariant HistoryModel::data(const QModelIndex &index, int role) const
|
|||||||
return -1;
|
return -1;
|
||||||
case Qt::ToolTipRole:
|
case Qt::ToolTipRole:
|
||||||
if (index.column() == 0) {
|
if (index.column() == 0) {
|
||||||
return QString("%1\n%2").arg(entry.title, entry.urlString);
|
return QSL("%1\n%2").arg(entry.title, entry.urlString);
|
||||||
}
|
}
|
||||||
// fallthrough
|
// fallthrough
|
||||||
case Qt::DisplayRole:
|
case Qt::DisplayRole:
|
||||||
@ -295,7 +295,7 @@ void HistoryModel::fetchMore(const QModelIndex &parent)
|
|||||||
}
|
}
|
||||||
|
|
||||||
QSqlQuery query(SqlDatabase::instance()->database());
|
QSqlQuery query(SqlDatabase::instance()->database());
|
||||||
query.prepare("SELECT id, count, title, url, date FROM history WHERE date BETWEEN ? AND ? ORDER BY date DESC");
|
query.prepare(QSL("SELECT id, count, title, url, date FROM history WHERE date BETWEEN ? AND ? ORDER BY date DESC"));
|
||||||
query.addBindValue(parentItem->endTimestamp());
|
query.addBindValue(parentItem->endTimestamp());
|
||||||
query.addBindValue(parentItem->startTimestamp());
|
query.addBindValue(parentItem->startTimestamp());
|
||||||
query.exec();
|
query.exec();
|
||||||
@ -309,7 +309,7 @@ void HistoryModel::fetchMore(const QModelIndex &parent)
|
|||||||
entry.title = query.value(2).toString();
|
entry.title = query.value(2).toString();
|
||||||
entry.url = query.value(3).toUrl();
|
entry.url = query.value(3).toUrl();
|
||||||
entry.date = QDateTime::fromMSecsSinceEpoch(query.value(4).toLongLong());
|
entry.date = QDateTime::fromMSecsSinceEpoch(query.value(4).toLongLong());
|
||||||
entry.urlString = entry.url.toEncoded();
|
entry.urlString = QString::fromUtf8(entry.url.toEncoded());
|
||||||
|
|
||||||
if (!idList.contains(entry.id)) {
|
if (!idList.contains(entry.id)) {
|
||||||
list.append(entry);
|
list.append(entry);
|
||||||
@ -445,7 +445,7 @@ void HistoryModel::checkEmptyParentItem(HistoryItem* item)
|
|||||||
void HistoryModel::init()
|
void HistoryModel::init()
|
||||||
{
|
{
|
||||||
QSqlQuery query(SqlDatabase::instance()->database());
|
QSqlQuery query(SqlDatabase::instance()->database());
|
||||||
query.exec("SELECT MIN(date) FROM history");
|
query.exec(QSL("SELECT MIN(date) FROM history"));
|
||||||
if (!query.next()) {
|
if (!query.next()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -487,11 +487,11 @@ void HistoryModel::init()
|
|||||||
|
|
||||||
timestamp = QDateTime(startDate, QTime(23, 59, 59), QTimeZone::systemTimeZone()).toMSecsSinceEpoch();
|
timestamp = QDateTime(startDate, QTime(23, 59, 59), QTimeZone::systemTimeZone()).toMSecsSinceEpoch();
|
||||||
endTimestamp = QDateTime(endDate, QTime(), QTimeZone::systemTimeZone()).toMSecsSinceEpoch();
|
endTimestamp = QDateTime(endDate, QTime(), QTimeZone::systemTimeZone()).toMSecsSinceEpoch();
|
||||||
itemName = QString("%1 %2").arg(History::titleCaseLocalizedMonth(timestampDate.month()), QString::number(timestampDate.year()));
|
itemName = QSL("%1 %2").arg(History::titleCaseLocalizedMonth(timestampDate.month()), QString::number(timestampDate.year()));
|
||||||
}
|
}
|
||||||
|
|
||||||
QSqlQuery query(SqlDatabase::instance()->database());
|
QSqlQuery query(SqlDatabase::instance()->database());
|
||||||
query.prepare("SELECT id FROM history WHERE date BETWEEN ? AND ? LIMIT 1");
|
query.prepare(QSL("SELECT id FROM history WHERE date BETWEEN ? AND ? LIMIT 1"));
|
||||||
query.addBindValue(endTimestamp);
|
query.addBindValue(endTimestamp);
|
||||||
query.addBindValue(timestamp);
|
query.addBindValue(timestamp);
|
||||||
query.exec();
|
query.exec();
|
||||||
|
@ -67,7 +67,7 @@ QSqlQuery LocationCompleterModel::createDomainQuery(const QString &text)
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool withoutWww = text.startsWith(QLatin1Char('w')) && !text.startsWith(QLatin1String("www."));
|
bool withoutWww = text.startsWith(QLatin1Char('w')) && !text.startsWith(QLatin1String("www."));
|
||||||
QString query = "SELECT url FROM history WHERE ";
|
QString query = QSL("SELECT url FROM history WHERE ");
|
||||||
|
|
||||||
if (withoutWww) {
|
if (withoutWww) {
|
||||||
query.append(QLatin1String("url NOT LIKE ? AND url NOT LIKE ? AND "));
|
query.append(QLatin1String("url NOT LIKE ? AND url NOT LIKE ? AND "));
|
||||||
@ -82,16 +82,16 @@ QSqlQuery LocationCompleterModel::createDomainQuery(const QString &text)
|
|||||||
sqlQuery.prepare(query);
|
sqlQuery.prepare(query);
|
||||||
|
|
||||||
if (withoutWww) {
|
if (withoutWww) {
|
||||||
sqlQuery.addBindValue(QString("http://www.%"));
|
sqlQuery.addBindValue(QSL("http://www.%"));
|
||||||
sqlQuery.addBindValue(QString("https://www.%"));
|
sqlQuery.addBindValue(QSL("https://www.%"));
|
||||||
sqlQuery.addBindValue(QString("http://%1%").arg(text));
|
sqlQuery.addBindValue(QSL("http://%1%").arg(text));
|
||||||
sqlQuery.addBindValue(QString("https://%1%").arg(text));
|
sqlQuery.addBindValue(QSL("https://%1%").arg(text));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
sqlQuery.addBindValue(QString("http://%1%").arg(text));
|
sqlQuery.addBindValue(QSL("http://%1%").arg(text));
|
||||||
sqlQuery.addBindValue(QString("https://%1%").arg(text));
|
sqlQuery.addBindValue(QSL("https://%1%").arg(text));
|
||||||
sqlQuery.addBindValue(QString("http://www.%1%").arg(text));
|
sqlQuery.addBindValue(QSL("http://www.%1%").arg(text));
|
||||||
sqlQuery.addBindValue(QString("https://www.%1%").arg(text));
|
sqlQuery.addBindValue(QSL("https://www.%1%").arg(text));
|
||||||
}
|
}
|
||||||
|
|
||||||
return sqlQuery;
|
return sqlQuery;
|
||||||
@ -122,13 +122,13 @@ QSqlQuery LocationCompleterModel::createHistoryQuery(const QString &searchString
|
|||||||
sqlQuery.prepare(query);
|
sqlQuery.prepare(query);
|
||||||
|
|
||||||
if (exactMatch) {
|
if (exactMatch) {
|
||||||
sqlQuery.addBindValue(QString("%%1%").arg(searchString));
|
sqlQuery.addBindValue(QSL("%%1%").arg(searchString));
|
||||||
sqlQuery.addBindValue(QString("%%1%").arg(searchString));
|
sqlQuery.addBindValue(QSL("%%1%").arg(searchString));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
for (const QString &str : qAsConst(searchList)) {
|
for (const QString &str : qAsConst(searchList)) {
|
||||||
sqlQuery.addBindValue(QString("%%1%").arg(str));
|
sqlQuery.addBindValue(QSL("%%1%").arg(str));
|
||||||
sqlQuery.addBindValue(QString("%%1%").arg(str));
|
sqlQuery.addBindValue(QSL("%%1%").arg(str));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -162,7 +162,7 @@ void LocationCompleterRefreshJob::completeFromHistory()
|
|||||||
}
|
}
|
||||||
|
|
||||||
auto* item = new QStandardItem();
|
auto* item = new QStandardItem();
|
||||||
item->setText(bookmark->url().toEncoded());
|
item->setText(QString::fromUtf8(bookmark->url().toEncoded()));
|
||||||
item->setData(-1, LocationCompleterModel::IdRole);
|
item->setData(-1, LocationCompleterModel::IdRole);
|
||||||
item->setData(bookmark->title(), LocationCompleterModel::TitleRole);
|
item->setData(bookmark->title(), LocationCompleterModel::TitleRole);
|
||||||
item->setData(bookmark->url(), LocationCompleterModel::UrlRole);
|
item->setData(bookmark->url(), LocationCompleterModel::UrlRole);
|
||||||
@ -193,7 +193,7 @@ void LocationCompleterRefreshJob::completeFromHistory()
|
|||||||
}
|
}
|
||||||
|
|
||||||
auto* item = new QStandardItem();
|
auto* item = new QStandardItem();
|
||||||
item->setText(url.toEncoded());
|
item->setText(QString::fromUtf8(url.toEncoded()));
|
||||||
item->setData(query.value(0), LocationCompleterModel::IdRole);
|
item->setData(query.value(0), LocationCompleterModel::IdRole);
|
||||||
item->setData(query.value(2), LocationCompleterModel::TitleRole);
|
item->setData(query.value(2), LocationCompleterModel::TitleRole);
|
||||||
item->setData(url, LocationCompleterModel::UrlRole);
|
item->setData(url, LocationCompleterModel::UrlRole);
|
||||||
@ -215,7 +215,7 @@ void LocationCompleterRefreshJob::completeMostVisited()
|
|||||||
auto* item = new QStandardItem();
|
auto* item = new QStandardItem();
|
||||||
const QUrl url = query.value(1).toUrl();
|
const QUrl url = query.value(1).toUrl();
|
||||||
|
|
||||||
item->setText(url.toEncoded());
|
item->setText(QString::fromUtf8(url.toEncoded()));
|
||||||
item->setData(query.value(0), LocationCompleterModel::IdRole);
|
item->setData(query.value(0), LocationCompleterModel::IdRole);
|
||||||
item->setData(query.value(2), LocationCompleterModel::TitleRole);
|
item->setData(query.value(2), LocationCompleterModel::TitleRole);
|
||||||
item->setData(url, LocationCompleterModel::UrlRole);
|
item->setData(url, LocationCompleterModel::UrlRole);
|
||||||
|
@ -489,7 +489,7 @@ void LocationBar::focusInEvent(QFocusEvent* event)
|
|||||||
clearTextFormat();
|
clearTextFormat();
|
||||||
LineEdit::focusInEvent(event);
|
LineEdit::focusInEvent(event);
|
||||||
|
|
||||||
if (m_window && Settings().value("Browser-View-Settings/instantBookmarksToolbar").toBool()) {
|
if (m_window && Settings().value(QSL("Browser-View-Settings/instantBookmarksToolbar")).toBool()) {
|
||||||
m_window->bookmarksToolbar()->show();
|
m_window->bookmarksToolbar()->show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -512,7 +512,7 @@ void LocationBar::focusOutEvent(QFocusEvent* event)
|
|||||||
|
|
||||||
refreshTextFormat();
|
refreshTextFormat();
|
||||||
|
|
||||||
if (m_window && Settings().value("Browser-View-Settings/instantBookmarksToolbar").toBool()) {
|
if (m_window && Settings().value(QSL("Browser-View-Settings/instantBookmarksToolbar")).toBool()) {
|
||||||
m_window->bookmarksToolbar()->hide();
|
m_window->bookmarksToolbar()->hide();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -660,10 +660,10 @@ void LocationBar::loadFinished()
|
|||||||
void LocationBar::loadSettings()
|
void LocationBar::loadSettings()
|
||||||
{
|
{
|
||||||
Settings settings;
|
Settings settings;
|
||||||
settings.beginGroup("AddressBar");
|
settings.beginGroup(QSL("AddressBar"));
|
||||||
m_progressStyle = static_cast<ProgressStyle>(settings.value("ProgressStyle", 0).toInt());
|
m_progressStyle = static_cast<ProgressStyle>(settings.value(QSL("ProgressStyle"), 0).toInt());
|
||||||
bool customColor = settings.value("UseCustomProgressColor", false).toBool();
|
bool customColor = settings.value(QSL("UseCustomProgressColor"), false).toBool();
|
||||||
m_progressColor = customColor ? settings.value("CustomProgressColor", palette().color(QPalette::Highlight)).value<QColor>() : QColor();
|
m_progressColor = customColor ? settings.value(QSL("CustomProgressColor"), palette().color(QPalette::Highlight)).value<QColor>() : QColor();
|
||||||
settings.endGroup();
|
settings.endGroup();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -150,8 +150,8 @@ void WebSearchBar::openSearchEnginesDialog()
|
|||||||
void WebSearchBar::enableSearchSuggestions(bool enable)
|
void WebSearchBar::enableSearchSuggestions(bool enable)
|
||||||
{
|
{
|
||||||
Settings settings;
|
Settings settings;
|
||||||
settings.beginGroup("SearchEngines");
|
settings.beginGroup(QSL("SearchEngines"));
|
||||||
settings.setValue("showSuggestions", enable);
|
settings.setValue(QSL("showSuggestions"), enable);
|
||||||
settings.endGroup();
|
settings.endGroup();
|
||||||
|
|
||||||
qzSettings->showWSBSearchSuggestions = enable;
|
qzSettings->showWSBSearchSuggestions = enable;
|
||||||
@ -213,8 +213,8 @@ void WebSearchBar::searchChanged(const ButtonWithMenu::Item &item)
|
|||||||
void WebSearchBar::instantSearchChanged(bool enable)
|
void WebSearchBar::instantSearchChanged(bool enable)
|
||||||
{
|
{
|
||||||
Settings settings;
|
Settings settings;
|
||||||
settings.beginGroup("SearchEngines");
|
settings.beginGroup(QSL("SearchEngines"));
|
||||||
settings.setValue("SearchOnEngineChange", enable);
|
settings.setValue(QSL("SearchOnEngineChange"), enable);
|
||||||
settings.endGroup();
|
settings.endGroup();
|
||||||
qzSettings->searchOnEngineChange = enable;
|
qzSettings->searchOnEngineChange = enable;
|
||||||
}
|
}
|
||||||
|
@ -268,18 +268,18 @@ void NetworkManager::unregisterExtensionSchemeHandler(ExtensionSchemeHandler *ha
|
|||||||
void NetworkManager::loadSettings()
|
void NetworkManager::loadSettings()
|
||||||
{
|
{
|
||||||
Settings settings;
|
Settings settings;
|
||||||
settings.beginGroup("Language");
|
settings.beginGroup(QSL("Language"));
|
||||||
QStringList langs = settings.value("acceptLanguage", AcceptLanguage::defaultLanguage()).toStringList();
|
QStringList langs = settings.value(QSL("acceptLanguage"), AcceptLanguage::defaultLanguage()).toStringList();
|
||||||
settings.endGroup();
|
settings.endGroup();
|
||||||
mApp->webProfile()->setHttpAcceptLanguage(AcceptLanguage::generateHeader(langs));
|
mApp->webProfile()->setHttpAcceptLanguage(QString::fromLatin1(AcceptLanguage::generateHeader(langs)));
|
||||||
|
|
||||||
QNetworkProxy proxy;
|
QNetworkProxy proxy;
|
||||||
settings.beginGroup("Web-Proxy");
|
settings.beginGroup(QSL("Web-Proxy"));
|
||||||
const int proxyType = settings.value("ProxyType", 2).toInt();
|
const int proxyType = settings.value(QSL("ProxyType"), 2).toInt();
|
||||||
proxy.setHostName(settings.value("HostName", QString()).toString());
|
proxy.setHostName(settings.value(QSL("HostName"), QString()).toString());
|
||||||
proxy.setPort(settings.value("Port", 8080).toInt());
|
proxy.setPort(settings.value(QSL("Port"), 8080).toInt());
|
||||||
proxy.setUser(settings.value("Username", QString()).toString());
|
proxy.setUser(settings.value(QSL("Username"), QString()).toString());
|
||||||
proxy.setPassword(settings.value("Password", QString()).toString());
|
proxy.setPassword(settings.value(QSL("Password"), QString()).toString());
|
||||||
settings.endGroup();
|
settings.endGroup();
|
||||||
|
|
||||||
if (proxyType == 0) {
|
if (proxyType == 0) {
|
||||||
@ -300,16 +300,16 @@ void NetworkManager::loadSettings()
|
|||||||
|
|
||||||
m_urlInterceptor->loadSettings();
|
m_urlInterceptor->loadSettings();
|
||||||
|
|
||||||
settings.beginGroup("Web-Browser-Settings");
|
settings.beginGroup(QSL("Web-Browser-Settings"));
|
||||||
m_ignoredSslHosts = settings.value("IgnoredSslHosts", QStringList()).toStringList();
|
m_ignoredSslHosts = settings.value(QSL("IgnoredSslHosts"), QStringList()).toStringList();
|
||||||
settings.endGroup();
|
settings.endGroup();
|
||||||
}
|
}
|
||||||
|
|
||||||
void NetworkManager::saveIgnoredSslHosts()
|
void NetworkManager::saveIgnoredSslHosts()
|
||||||
{
|
{
|
||||||
Settings settings;
|
Settings settings;
|
||||||
settings.beginGroup("Web-Browser-Settings");
|
settings.beginGroup(QSL("Web-Browser-Settings"));
|
||||||
settings.setValue("IgnoredSslHosts", m_ignoredSslHosts);
|
settings.setValue(QSL("IgnoredSslHosts"), m_ignoredSslHosts);
|
||||||
settings.endGroup();
|
settings.endGroup();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -84,8 +84,8 @@ void NetworkUrlInterceptor::loadSettings()
|
|||||||
QMutexLocker lock(&m_mutex);
|
QMutexLocker lock(&m_mutex);
|
||||||
|
|
||||||
Settings settings;
|
Settings settings;
|
||||||
settings.beginGroup("Web-Browser-Settings");
|
settings.beginGroup(QSL("Web-Browser-Settings"));
|
||||||
m_sendDNT = settings.value("DoNotTrack", false).toBool();
|
m_sendDNT = settings.value(QSL("DoNotTrack"), false).toBool();
|
||||||
settings.endGroup();
|
settings.endGroup();
|
||||||
|
|
||||||
m_usePerDomainUserAgent = mApp->userAgentManager()->usePerDomainUserAgents();
|
m_usePerDomainUserAgent = mApp->userAgentManager()->usePerDomainUserAgents();
|
||||||
|
@ -53,7 +53,7 @@ void FalkonSchemeHandler::requestStarted(QWebEngineUrlRequestJob *job)
|
|||||||
}
|
}
|
||||||
|
|
||||||
QStringList knownPages;
|
QStringList knownPages;
|
||||||
knownPages << "about" << "start" << "speeddial" << "config" << "restore";
|
knownPages << QSL("about") << QSL("start") << QSL("speeddial") << QSL("config") << QSL("restore");
|
||||||
|
|
||||||
if (knownPages.contains(job->requestUrl().path()))
|
if (knownPages.contains(job->requestUrl().path()))
|
||||||
job->reply(QByteArrayLiteral("text/html"), new FalkonSchemeReply(job, job));
|
job->reply(QByteArrayLiteral("text/html"), new FalkonSchemeReply(job, job));
|
||||||
@ -76,7 +76,7 @@ bool FalkonSchemeHandler::handleRequest(QWebEngineUrlRequestJob *job)
|
|||||||
job->redirect(QUrl(QSL("falkon:start")));
|
job->redirect(QUrl(QSL("falkon:start")));
|
||||||
return true;
|
return true;
|
||||||
} else if (job->requestUrl().path() == QL1S("reportbug")) {
|
} else if (job->requestUrl().path() == QL1S("reportbug")) {
|
||||||
job->redirect(QUrl(Qz::BUGSADDRESS));
|
job->redirect(QUrl(QString::fromLatin1(Qz::BUGSADDRESS)));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -149,14 +149,14 @@ QString FalkonSchemeReply::startPage()
|
|||||||
return sPage;
|
return sPage;
|
||||||
}
|
}
|
||||||
|
|
||||||
sPage.append(QzTools::readAllFileContents(":html/start.html"));
|
sPage.append(QzTools::readAllFileContents(QSL(":html/start.html")));
|
||||||
sPage.replace(QLatin1String("%ABOUT-IMG%"), QSL("qrc:icons/other/startpage.svg"));
|
sPage.replace(QLatin1String("%ABOUT-IMG%"), QSL("qrc:icons/other/startpage.svg"));
|
||||||
sPage.replace(QLatin1String("%ABOUT-IMG-DARK%"), QSL("qrc:icons/other/startpage-dark.svg"));
|
sPage.replace(QLatin1String("%ABOUT-IMG-DARK%"), QSL("qrc:icons/other/startpage-dark.svg"));
|
||||||
|
|
||||||
sPage.replace(QLatin1String("%TITLE%"), tr("Start Page"));
|
sPage.replace(QLatin1String("%TITLE%"), tr("Start Page"));
|
||||||
sPage.replace(QLatin1String("%BUTTON-LABEL%"), tr("Search on Web"));
|
sPage.replace(QLatin1String("%BUTTON-LABEL%"), tr("Search on Web"));
|
||||||
sPage.replace(QLatin1String("%SEARCH-BY%"), tr("Search results provided by DuckDuckGo"));
|
sPage.replace(QLatin1String("%SEARCH-BY%"), tr("Search results provided by DuckDuckGo"));
|
||||||
sPage.replace(QLatin1String("%WWW%"), Qz::WIKIADDRESS);
|
sPage.replace(QLatin1String("%WWW%"), QString::fromLatin1(Qz::WIKIADDRESS));
|
||||||
sPage.replace(QLatin1String("%ABOUT-FALKON%"), tr("About Falkon"));
|
sPage.replace(QLatin1String("%ABOUT-FALKON%"), tr("About Falkon"));
|
||||||
sPage.replace(QLatin1String("%PRIVATE-BROWSING%"), mApp->isPrivate() ? tr("<h1>Private Browsing</h1>") : QString());
|
sPage.replace(QLatin1String("%PRIVATE-BROWSING%"), mApp->isPrivate() ? tr("<h1>Private Browsing</h1>") : QString());
|
||||||
sPage = QzTools::applyDirectionToPage(sPage);
|
sPage = QzTools::applyDirectionToPage(sPage);
|
||||||
@ -169,10 +169,10 @@ QString FalkonSchemeReply::aboutPage()
|
|||||||
static QString aPage;
|
static QString aPage;
|
||||||
|
|
||||||
if (aPage.isEmpty()) {
|
if (aPage.isEmpty()) {
|
||||||
aPage.append(QzTools::readAllFileContents(":html/about.html"));
|
aPage.append(QzTools::readAllFileContents(QSL(":html/about.html")));
|
||||||
aPage.replace(QLatin1String("%ABOUT-IMG%"), QSL("qrc:icons/other/about.svg"));
|
aPage.replace(QLatin1String("%ABOUT-IMG%"), QSL("qrc:icons/other/about.svg"));
|
||||||
aPage.replace(QLatin1String("%ABOUT-IMG-DARK%"), QSL("qrc:icons/other/about-dark.svg"));
|
aPage.replace(QLatin1String("%ABOUT-IMG-DARK%"), QSL("qrc:icons/other/about-dark.svg"));
|
||||||
aPage.replace(QLatin1String("%COPYRIGHT-INCLUDE%"), QzTools::readAllFileContents(":html/copyright").toHtmlEscaped());
|
aPage.replace(QLatin1String("%COPYRIGHT-INCLUDE%"), QzTools::readAllFileContents(QSL(":html/copyright")).toHtmlEscaped());
|
||||||
|
|
||||||
aPage.replace(QLatin1String("%TITLE%"), tr("About Falkon"));
|
aPage.replace(QLatin1String("%TITLE%"), tr("About Falkon"));
|
||||||
aPage.replace(QLatin1String("%ABOUT-FALKON%"), tr("About Falkon"));
|
aPage.replace(QLatin1String("%ABOUT-FALKON%"), tr("About Falkon"));
|
||||||
@ -180,15 +180,15 @@ QString FalkonSchemeReply::aboutPage()
|
|||||||
aPage.replace(QLatin1String("%COPYRIGHT%"), tr("Copyright"));
|
aPage.replace(QLatin1String("%COPYRIGHT%"), tr("Copyright"));
|
||||||
|
|
||||||
aPage.replace(QLatin1String("%VERSION-INFO%"),
|
aPage.replace(QLatin1String("%VERSION-INFO%"),
|
||||||
QString("<dt>%1</dt><dd>%2<dd>").arg(tr("Version"),
|
QSL("<dt>%1</dt><dd>%2<dd>").arg(tr("Version"),
|
||||||
#ifdef FALKON_GIT_REVISION
|
#ifdef FALKON_GIT_REVISION
|
||||||
QString("%1 (%2)").arg(Qz::VERSION, FALKON_GIT_REVISION)));
|
QSL("%1 (%2)").arg(QString::fromLatin1(Qz::VERSION), QL1S(FALKON_GIT_REVISION))));
|
||||||
#else
|
#else
|
||||||
Qz::VERSION));
|
QString::fromLatin1(Qz::VERSION)));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
aPage.replace(QLatin1String("%MAIN-DEVELOPER%"), tr("Main developer"));
|
aPage.replace(QLatin1String("%MAIN-DEVELOPER%"), tr("Main developer"));
|
||||||
aPage.replace(QLatin1String("%MAIN-DEVELOPER-TEXT%"), authorString(Qz::AUTHOR, "nowrep@gmail.com"));
|
aPage.replace(QLatin1String("%MAIN-DEVELOPER-TEXT%"), authorString(Qz::AUTHOR, QSL("nowrep@gmail.com")));
|
||||||
aPage = QzTools::applyDirectionToPage(aPage);
|
aPage = QzTools::applyDirectionToPage(aPage);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -200,7 +200,7 @@ QString FalkonSchemeReply::speeddialPage()
|
|||||||
static QString dPage;
|
static QString dPage;
|
||||||
|
|
||||||
if (dPage.isEmpty()) {
|
if (dPage.isEmpty()) {
|
||||||
dPage.append(QzTools::readAllFileContents(":html/speeddial.html"));
|
dPage.append(QzTools::readAllFileContents(QSL(":html/speeddial.html")));
|
||||||
dPage.replace(QLatin1String("%IMG_PLUS%"), QLatin1String("qrc:html/plus.svg"));
|
dPage.replace(QLatin1String("%IMG_PLUS%"), QLatin1String("qrc:html/plus.svg"));
|
||||||
dPage.replace(QLatin1String("%IMG_CLOSE%"), QLatin1String("qrc:html/close.svg"));
|
dPage.replace(QLatin1String("%IMG_CLOSE%"), QLatin1String("qrc:html/close.svg"));
|
||||||
dPage.replace(QLatin1String("%IMG_EDIT%"), QLatin1String("qrc:html/edit.svg"));
|
dPage.replace(QLatin1String("%IMG_EDIT%"), QLatin1String("qrc:html/edit.svg"));
|
||||||
@ -240,7 +240,7 @@ QString FalkonSchemeReply::speeddialPage()
|
|||||||
QString page = dPage;
|
QString page = dPage;
|
||||||
SpeedDial* dial = mApp->plugins()->speedDial();
|
SpeedDial* dial = mApp->plugins()->speedDial();
|
||||||
|
|
||||||
page.replace(QLatin1String("%INITIAL-SCRIPT%"), dial->initialScript().toUtf8().toBase64());
|
page.replace(QLatin1String("%INITIAL-SCRIPT%"), QString::fromLatin1(dial->initialScript().toUtf8().toBase64()));
|
||||||
page.replace(QLatin1String("%IMG_BACKGROUND%"), dial->backgroundImage());
|
page.replace(QLatin1String("%IMG_BACKGROUND%"), dial->backgroundImage());
|
||||||
page.replace(QLatin1String("%URL_BACKGROUND%"), dial->backgroundImageUrl());
|
page.replace(QLatin1String("%URL_BACKGROUND%"), dial->backgroundImageUrl());
|
||||||
page.replace(QLatin1String("%B_SIZE%"), dial->backgroundImageSize());
|
page.replace(QLatin1String("%B_SIZE%"), dial->backgroundImageSize());
|
||||||
@ -256,7 +256,7 @@ QString FalkonSchemeReply::restorePage()
|
|||||||
static QString rPage;
|
static QString rPage;
|
||||||
|
|
||||||
if (rPage.isEmpty()) {
|
if (rPage.isEmpty()) {
|
||||||
rPage.append(QzTools::readAllFileContents(":html/restore.html"));
|
rPage.append(QzTools::readAllFileContents(QSL(":html/restore.html")));
|
||||||
rPage.replace(QLatin1String("%IMAGE%"), QzTools::pixmapToDataUrl(IconProvider::standardIcon(QStyle::SP_MessageBoxWarning).pixmap(45)).toString());
|
rPage.replace(QLatin1String("%IMAGE%"), QzTools::pixmapToDataUrl(IconProvider::standardIcon(QStyle::SP_MessageBoxWarning).pixmap(45)).toString());
|
||||||
rPage.replace(QLatin1String("%TITLE%"), tr("Restore Session"));
|
rPage.replace(QLatin1String("%TITLE%"), tr("Restore Session"));
|
||||||
rPage.replace(QLatin1String("%OOPS%"), tr("Oops, Falkon crashed."));
|
rPage.replace(QLatin1String("%OOPS%"), tr("Oops, Falkon crashed."));
|
||||||
@ -279,7 +279,7 @@ QString FalkonSchemeReply::configPage()
|
|||||||
static QString cPage;
|
static QString cPage;
|
||||||
|
|
||||||
if (cPage.isEmpty()) {
|
if (cPage.isEmpty()) {
|
||||||
cPage.append(QzTools::readAllFileContents(":html/config.html"));
|
cPage.append(QzTools::readAllFileContents(QSL(":html/config.html")));
|
||||||
cPage.replace(QLatin1String("%ABOUT-IMG%"), QSL("qrc:icons/other/about.svg"));
|
cPage.replace(QLatin1String("%ABOUT-IMG%"), QSL("qrc:icons/other/about.svg"));
|
||||||
cPage.replace(QLatin1String("%ABOUT-IMG-DARK%"), QSL("qrc:icons/other/about-dark.svg"));
|
cPage.replace(QLatin1String("%ABOUT-IMG-DARK%"), QSL("qrc:icons/other/about-dark.svg"));
|
||||||
|
|
||||||
@ -312,24 +312,24 @@ QString FalkonSchemeReply::configPage()
|
|||||||
};
|
};
|
||||||
|
|
||||||
cPage.replace(QLatin1String("%VERSION-INFO%"),
|
cPage.replace(QLatin1String("%VERSION-INFO%"),
|
||||||
QString("<dt>%1</dt><dd>%2<dd>").arg(tr("Application version"),
|
QSL("<dt>%1</dt><dd>%2<dd>").arg(tr("Application version"),
|
||||||
#ifdef FALKON_GIT_REVISION
|
#ifdef FALKON_GIT_REVISION
|
||||||
QString("%1 (%2)").arg(Qz::VERSION, FALKON_GIT_REVISION)
|
QSL("%1 (%2)").arg(QString::fromLatin1(Qz::VERSION), QL1S(FALKON_GIT_REVISION))
|
||||||
#else
|
#else
|
||||||
Qz::VERSION
|
QString::fromLatin1(Qz::VERSION)
|
||||||
#endif
|
#endif
|
||||||
) +
|
) +
|
||||||
QString("<dt>%1</dt><dd>%2<dd>").arg(tr("Qt version"), qVersion()) +
|
QSL("<dt>%1</dt><dd>%2<dd>").arg(tr("Qt version"), QString::fromLatin1(qVersion())) +
|
||||||
QString("<dt>%1</dt><dd>%2<dd>").arg(tr("QtWebEngine version"), QSL(QTWEBENGINECORE_VERSION_STR)) +
|
QSL("<dt>%1</dt><dd>%2<dd>").arg(tr("QtWebEngine version"), QSL(QTWEBENGINECORE_VERSION_STR)) +
|
||||||
QString("<dt>%1</dt><dd>%2<dd>").arg(tr("Platform"), QzTools::operatingSystemLong()));
|
QSL("<dt>%1</dt><dd>%2<dd>").arg(tr("Platform"), QzTools::operatingSystemLong()));
|
||||||
|
|
||||||
cPage.replace(QLatin1String("%PATHS-TEXT%"),
|
cPage.replace(QLatin1String("%PATHS-TEXT%"),
|
||||||
QString("<dt>%1</dt><dd>%2<dd>").arg(tr("Profile"), DataPaths::currentProfilePath()) +
|
QSL("<dt>%1</dt><dd>%2<dd>").arg(tr("Profile"), DataPaths::currentProfilePath()) +
|
||||||
QString("<dt>%1</dt><dd>%2<dd>").arg(tr("Settings"), DataPaths::currentProfilePath() + "/settings.ini") +
|
QSL("<dt>%1</dt><dd>%2<dd>").arg(tr("Settings"), DataPaths::currentProfilePath() + QSL("/settings.ini")) +
|
||||||
QString("<dt>%1</dt><dd>%2<dd>").arg(tr("Saved session"), SessionManager::defaultSessionPath()) +
|
QSL("<dt>%1</dt><dd>%2<dd>").arg(tr("Saved session"), SessionManager::defaultSessionPath()) +
|
||||||
QString("<dt>%1</dt><dd>%2<dd>").arg(tr("Data"), allPaths(DataPaths::AppData)) +
|
QSL("<dt>%1</dt><dd>%2<dd>").arg(tr("Data"), allPaths(DataPaths::AppData)) +
|
||||||
QString("<dt>%1</dt><dd>%2<dd>").arg(tr("Themes"), allPaths(DataPaths::Themes)) +
|
QSL("<dt>%1</dt><dd>%2<dd>").arg(tr("Themes"), allPaths(DataPaths::Themes)) +
|
||||||
QString("<dt>%1</dt><dd>%2<dd>").arg(tr("Extensions"), allPaths(DataPaths::Plugins)));
|
QSL("<dt>%1</dt><dd>%2<dd>").arg(tr("Extensions"), allPaths(DataPaths::Plugins)));
|
||||||
|
|
||||||
#ifdef QT_DEBUG
|
#ifdef QT_DEBUG
|
||||||
QString debugBuild = tr("<b>Enabled</b>");
|
QString debugBuild = tr("<b>Enabled</b>");
|
||||||
@ -348,11 +348,11 @@ QString FalkonSchemeReply::configPage()
|
|||||||
QString portableBuild = mApp->isPortable() ? tr("<b>Enabled</b>") : tr("Disabled");
|
QString portableBuild = mApp->isPortable() ? tr("<b>Enabled</b>") : tr("Disabled");
|
||||||
|
|
||||||
cPage.replace(QLatin1String("%BUILD-CONFIG-TEXT%"),
|
cPage.replace(QLatin1String("%BUILD-CONFIG-TEXT%"),
|
||||||
QString("<dt>%1</dt><dd>%2<dd>").arg(tr("Debug build"), debugBuild) +
|
QSL("<dt>%1</dt><dd>%2<dd>").arg(tr("Debug build"), debugBuild) +
|
||||||
#ifdef Q_OS_WIN
|
#ifdef Q_OS_WIN
|
||||||
QString("<dt>%1</dt><dd>%2<dd>").arg(tr("Windows 7 API"), w7APIEnabled) +
|
QSL("<dt>%1</dt><dd>%2<dd>").arg(tr("Windows 7 API"), w7APIEnabled) +
|
||||||
#endif
|
#endif
|
||||||
QString("<dt>%1</dt><dd>%2<dd>").arg(tr("Portable build"), portableBuild));
|
QSL("<dt>%1</dt><dd>%2<dd>").arg(tr("Portable build"), portableBuild));
|
||||||
|
|
||||||
cPage = QzTools::applyDirectionToPage(cPage);
|
cPage = QzTools::applyDirectionToPage(cPage);
|
||||||
}
|
}
|
||||||
@ -365,12 +365,12 @@ QString FalkonSchemeReply::configPage()
|
|||||||
|
|
||||||
for (const Plugins::Plugin &plugin : availablePlugins) {
|
for (const Plugins::Plugin &plugin : availablePlugins) {
|
||||||
PluginSpec spec = plugin.pluginSpec;
|
PluginSpec spec = plugin.pluginSpec;
|
||||||
pluginsString.append(QString("<tr><td>%1</td><td>%2</td><td>%3</td><td>%4</td></tr>").arg(
|
pluginsString.append(QSL("<tr><td>%1</td><td>%2</td><td>%3</td><td>%4</td></tr>").arg(
|
||||||
spec.name, spec.version, spec.author.toHtmlEscaped(), spec.description));
|
spec.name, spec.version, spec.author.toHtmlEscaped(), spec.description));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pluginsString.isEmpty()) {
|
if (pluginsString.isEmpty()) {
|
||||||
pluginsString = QString("<tr><td colspan=4 class=\"no-available-plugins\">%1</td></tr>").arg(tr("No available extensions."));
|
pluginsString = QSL("<tr><td colspan=4 class=\"no-available-plugins\">%1</td></tr>").arg(tr("No available extensions."));
|
||||||
}
|
}
|
||||||
|
|
||||||
page.replace(QLatin1String("%PLUGINS-INFO%"), pluginsString);
|
page.replace(QLatin1String("%PLUGINS-INFO%"), pluginsString);
|
||||||
@ -379,7 +379,7 @@ QString FalkonSchemeReply::configPage()
|
|||||||
QSettings* settings = Settings::globalSettings();
|
QSettings* settings = Settings::globalSettings();
|
||||||
const auto groups = settings->childGroups();
|
const auto groups = settings->childGroups();
|
||||||
for (const QString &group : groups) {
|
for (const QString &group : groups) {
|
||||||
QString groupString = QString("<tr><th colspan=\"2\">[%1]</th></tr>").arg(group);
|
QString groupString = QSL("<tr><th colspan=\"2\">[%1]</th></tr>").arg(group);
|
||||||
settings->beginGroup(group);
|
settings->beginGroup(group);
|
||||||
|
|
||||||
const auto keys = settings->childKeys();
|
const auto keys = settings->childKeys();
|
||||||
@ -394,12 +394,12 @@ QString FalkonSchemeReply::configPage()
|
|||||||
|
|
||||||
case QVariant::Point: {
|
case QVariant::Point: {
|
||||||
const QPoint point = keyValue.toPoint();
|
const QPoint point = keyValue.toPoint();
|
||||||
keyString = QString("QPoint(%1, %2)").arg(point.x()).arg(point.y());
|
keyString = QSL("QPoint(%1, %2)").arg(point.x()).arg(point.y());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case QVariant::StringList:
|
case QVariant::StringList:
|
||||||
keyString = keyValue.toStringList().join(",");
|
keyString = keyValue.toStringList().join(QSL(","));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
@ -410,7 +410,7 @@ QString FalkonSchemeReply::configPage()
|
|||||||
keyString = QLatin1String("\"empty\"");
|
keyString = QLatin1String("\"empty\"");
|
||||||
}
|
}
|
||||||
|
|
||||||
groupString.append(QString("<tr><td>%1</td><td>%2</td></tr>").arg(key, keyString.toHtmlEscaped()));
|
groupString.append(QSL("<tr><td>%1</td><td>%2</td></tr>").arg(key, keyString.toHtmlEscaped()));
|
||||||
}
|
}
|
||||||
|
|
||||||
settings->endGroup();
|
settings->endGroup();
|
||||||
|
@ -40,15 +40,15 @@ DesktopNotificationsFactory::DesktopNotificationsFactory(QObject* parent)
|
|||||||
void DesktopNotificationsFactory::loadSettings()
|
void DesktopNotificationsFactory::loadSettings()
|
||||||
{
|
{
|
||||||
Settings settings;
|
Settings settings;
|
||||||
settings.beginGroup("Notifications");
|
settings.beginGroup(QSL("Notifications"));
|
||||||
m_enabled = settings.value("Enabled", true).toBool();
|
m_enabled = settings.value(QSL("Enabled"), true).toBool();
|
||||||
m_timeout = settings.value("Timeout", 6000).toInt();
|
m_timeout = settings.value(QSL("Timeout"), 6000).toInt();
|
||||||
#if defined(Q_OS_UNIX) && !defined(DISABLE_DBUS)
|
#if defined(Q_OS_UNIX) && !defined(DISABLE_DBUS)
|
||||||
m_notifType = settings.value("UseNativeDesktop", true).toBool() ? DesktopNative : PopupWidget;
|
m_notifType = settings.value(QSL("UseNativeDesktop"), true).toBool() ? DesktopNative : PopupWidget;
|
||||||
#else
|
#else
|
||||||
m_notifType = PopupWidget;
|
m_notifType = PopupWidget;
|
||||||
#endif
|
#endif
|
||||||
m_position = settings.value("Position", QPoint(10, 10)).toPoint();
|
m_position = settings.value(QSL("Position"), QPoint(10, 10)).toPoint();
|
||||||
settings.endGroup();
|
settings.endGroup();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -94,7 +94,7 @@ void DesktopNotificationsFactory::showNotification(const QPixmap &icon, const QS
|
|||||||
{QStringLiteral("desktop-entry"), QGuiApplication::desktopFileName()}
|
{QStringLiteral("desktop-entry"), QGuiApplication::desktopFileName()}
|
||||||
};
|
};
|
||||||
|
|
||||||
QDBusInterface dbus("org.freedesktop.Notifications", "/org/freedesktop/Notifications", "org.freedesktop.Notifications", QDBusConnection::sessionBus());
|
QDBusInterface dbus(QSL("org.freedesktop.Notifications"), QSL("/org/freedesktop/Notifications"), QSL("org.freedesktop.Notifications"), QDBusConnection::sessionBus());
|
||||||
QVariantList args;
|
QVariantList args;
|
||||||
args.append(QLatin1String("Falkon"));
|
args.append(QLatin1String("Falkon"));
|
||||||
args.append(m_uint);
|
args.append(m_uint);
|
||||||
@ -104,7 +104,7 @@ void DesktopNotificationsFactory::showNotification(const QPixmap &icon, const QS
|
|||||||
args.append(QStringList());
|
args.append(QStringList());
|
||||||
args.append(hints);
|
args.append(hints);
|
||||||
args.append(m_timeout);
|
args.append(m_timeout);
|
||||||
dbus.callWithCallback("Notify", args, this, SLOT(updateLastId(QDBusMessage)), SLOT(error(QDBusError)));
|
dbus.callWithCallback(QSL("Notify"), args, this, SLOT(updateLastId(QDBusMessage)), SLOT(error(QDBusError)));
|
||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -245,7 +245,7 @@ QByteArray OpenSearchEngine::getPostData(const QString &searchTerm) const
|
|||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
QUrl retVal = QUrl("http://foo.bar");
|
QUrl retVal = QUrl(QSL("http://foo.bar"));
|
||||||
|
|
||||||
QUrlQuery query(retVal);
|
QUrlQuery query(retVal);
|
||||||
Parameters::const_iterator end = m_searchParameters.constEnd();
|
Parameters::const_iterator end = m_searchParameters.constEnd();
|
||||||
@ -530,7 +530,7 @@ void OpenSearchEngine::setSuggestionsUrl(const QString &string)
|
|||||||
|
|
||||||
QString OpenSearchEngine::getSuggestionsUrl()
|
QString OpenSearchEngine::getSuggestionsUrl()
|
||||||
{
|
{
|
||||||
return suggestionsUrl("searchstring").toString().replace(QLatin1String("searchstring"), QLatin1String("%s"));
|
return suggestionsUrl(QSL("searchstring")).toString().replace(QLatin1String("searchstring"), QLatin1String("%s"));
|
||||||
}
|
}
|
||||||
|
|
||||||
QByteArray OpenSearchEngine::getSuggestionsParameters()
|
QByteArray OpenSearchEngine::getSuggestionsParameters()
|
||||||
|
@ -97,7 +97,7 @@ OpenSearchEngine* OpenSearchReader::read(QIODevice* device)
|
|||||||
OpenSearchEngine* OpenSearchReader::read()
|
OpenSearchEngine* OpenSearchReader::read()
|
||||||
{
|
{
|
||||||
auto* engine = new OpenSearchEngine();
|
auto* engine = new OpenSearchEngine();
|
||||||
m_searchXml = device()->peek(1024 * 5);
|
m_searchXml = QString::fromLatin1(device()->peek(1024 * 5));
|
||||||
|
|
||||||
if (!m_searchXml.contains(QLatin1String("http://a9.com/-/spec/opensearch/1.1/")) &&
|
if (!m_searchXml.contains(QLatin1String("http://a9.com/-/spec/opensearch/1.1/")) &&
|
||||||
!m_searchXml.contains(QLatin1String("http://www.mozilla.org/2006/browser/search/"))
|
!m_searchXml.contains(QLatin1String("http://www.mozilla.org/2006/browser/search/"))
|
||||||
|
@ -108,7 +108,7 @@ void SearchEnginesDialog::editEngine()
|
|||||||
|
|
||||||
dialog.setName(engine.name);
|
dialog.setName(engine.name);
|
||||||
dialog.setUrl(engine.url);
|
dialog.setUrl(engine.url);
|
||||||
dialog.setPostData(engine.postData);
|
dialog.setPostData(QString::fromUtf8(engine.postData));
|
||||||
dialog.setShortcut(engine.shortcut);
|
dialog.setShortcut(engine.shortcut);
|
||||||
dialog.setIcon(engine.icon);
|
dialog.setIcon(engine.icon);
|
||||||
|
|
||||||
|
@ -69,9 +69,9 @@ SearchEnginesManager::SearchEnginesManager(QObject* parent)
|
|||||||
, m_saveScheduled(false)
|
, m_saveScheduled(false)
|
||||||
{
|
{
|
||||||
Settings settings;
|
Settings settings;
|
||||||
settings.beginGroup("SearchEngines");
|
settings.beginGroup(QSL("SearchEngines"));
|
||||||
m_startingEngineName = settings.value("activeEngine", "DuckDuckGo").toString();
|
m_startingEngineName = settings.value(QSL("activeEngine"), QSL("DuckDuckGo")).toString();
|
||||||
m_defaultEngineName = settings.value("DefaultEngine", "DuckDuckGo").toString();
|
m_defaultEngineName = settings.value(QSL("DefaultEngine"), QSL("DuckDuckGo")).toString();
|
||||||
settings.endGroup();
|
settings.endGroup();
|
||||||
|
|
||||||
connect(this, &SearchEnginesManager::enginesChanged, this, &SearchEnginesManager::scheduleSave);
|
connect(this, &SearchEnginesManager::enginesChanged, this, &SearchEnginesManager::scheduleSave);
|
||||||
@ -82,7 +82,7 @@ void SearchEnginesManager::loadSettings()
|
|||||||
m_settingsLoaded = true;
|
m_settingsLoaded = true;
|
||||||
|
|
||||||
QSqlQuery query(SqlDatabase::instance()->database());
|
QSqlQuery query(SqlDatabase::instance()->database());
|
||||||
query.exec("SELECT name, icon, url, shortcut, suggestionsUrl, suggestionsParameters, postData FROM search_engines");
|
query.exec(QSL("SELECT name, icon, url, shortcut, suggestionsUrl, suggestionsParameters, postData FROM search_engines"));
|
||||||
|
|
||||||
while (query.next()) {
|
while (query.next()) {
|
||||||
Engine en;
|
Engine en;
|
||||||
@ -158,33 +158,33 @@ LoadRequest SearchEnginesManager::searchResult(const QString &string)
|
|||||||
void SearchEnginesManager::restoreDefaults()
|
void SearchEnginesManager::restoreDefaults()
|
||||||
{
|
{
|
||||||
Engine duck;
|
Engine duck;
|
||||||
duck.name = "DuckDuckGo";
|
duck.name = QSL("DuckDuckGo");
|
||||||
duck.icon = QIcon(":/icons/sites/duck.png");
|
duck.icon = QIcon(QSL(":/icons/sites/duck.png"));
|
||||||
duck.url = "https://duckduckgo.com/?q=%s&t=qupzilla";
|
duck.url = QSL("https://duckduckgo.com/?q=%s&t=qupzilla");
|
||||||
duck.shortcut = "d";
|
duck.shortcut = QSL("d");
|
||||||
duck.suggestionsUrl = "https://ac.duckduckgo.com/ac/?q=%s&type=list";
|
duck.suggestionsUrl = QSL("https://ac.duckduckgo.com/ac/?q=%s&type=list");
|
||||||
|
|
||||||
Engine sp;
|
Engine sp;
|
||||||
sp.name = "StartPage";
|
sp.name = QSL("StartPage");
|
||||||
sp.icon = QIcon(":/icons/sites/startpage.png");
|
sp.icon = QIcon(QSL(":/icons/sites/startpage.png"));
|
||||||
sp.url = "https://startpage.com/do/search";
|
sp.url = QSL("https://startpage.com/do/search");
|
||||||
sp.postData = "query=%s&cat=web&language=english";
|
sp.postData = "query=%s&cat=web&language=english";
|
||||||
sp.shortcut = "sp";
|
sp.shortcut = QSL("sp");
|
||||||
sp.suggestionsUrl = "https://startpage.com/cgi-bin/csuggest?output=json&lang=english&query=%s";
|
sp.suggestionsUrl = QSL("https://startpage.com/cgi-bin/csuggest?output=json&lang=english&query=%s");
|
||||||
|
|
||||||
Engine wiki;
|
Engine wiki;
|
||||||
wiki.name = "Wikipedia (en)";
|
wiki.name = QSL("Wikipedia (en)");
|
||||||
wiki.icon = QIcon(":/icons/sites/wikipedia.png");
|
wiki.icon = QIcon(QSL(":/icons/sites/wikipedia.png"));
|
||||||
wiki.url = "https://en.wikipedia.org/wiki/Special:Search?search=%s&fulltext=Search";
|
wiki.url = QSL("https://en.wikipedia.org/wiki/Special:Search?search=%s&fulltext=Search");
|
||||||
wiki.shortcut = "w";
|
wiki.shortcut = QSL("w");
|
||||||
wiki.suggestionsUrl = "https://en.wikipedia.org/w/api.php?action=opensearch&search=%s&namespace=0";
|
wiki.suggestionsUrl = QSL("https://en.wikipedia.org/w/api.php?action=opensearch&search=%s&namespace=0");
|
||||||
|
|
||||||
Engine google;
|
Engine google;
|
||||||
google.name = "Google";
|
google.name = QSL("Google");
|
||||||
google.icon = QIcon(":icons/sites/google.png");
|
google.icon = QIcon(QSL(":icons/sites/google.png"));
|
||||||
google.url = "https://www.google.com/search?client=falkon&q=%s";
|
google.url = QSL("https://www.google.com/search?client=falkon&q=%s");
|
||||||
google.shortcut = "g";
|
google.shortcut = QSL("g");
|
||||||
google.suggestionsUrl = "https://suggestqueries.google.com/complete/search?output=firefox&q=%s";
|
google.suggestionsUrl = QSL("https://suggestqueries.google.com/complete/search?output=firefox&q=%s");
|
||||||
|
|
||||||
addEngine(duck);
|
addEngine(duck);
|
||||||
addEngine(sp);
|
addEngine(sp);
|
||||||
@ -218,7 +218,7 @@ void SearchEnginesManager::engineChangedImage()
|
|||||||
|
|
||||||
for (Engine e : qAsConst(m_allEngines)) {
|
for (Engine e : qAsConst(m_allEngines)) {
|
||||||
if (e.name == engine->name() &&
|
if (e.name == engine->name() &&
|
||||||
e.url.contains(engine->searchUrl("%s").toString()) &&
|
e.url.contains(engine->searchUrl(QSL("%s")).toString()) &&
|
||||||
!engine->image().isNull()
|
!engine->image().isNull()
|
||||||
) {
|
) {
|
||||||
int index = m_allEngines.indexOf(e);
|
int index = m_allEngines.indexOf(e);
|
||||||
@ -270,7 +270,7 @@ void SearchEnginesManager::addEngineFromForm(const QVariantMap &formData, WebVie
|
|||||||
QUrl parameterUrl = actionUrl;
|
QUrl parameterUrl = actionUrl;
|
||||||
|
|
||||||
if (isPost) {
|
if (isPost) {
|
||||||
parameterUrl = QUrl("http://foo.bar");
|
parameterUrl = QUrl(QSL("http://foo.bar"));
|
||||||
}
|
}
|
||||||
|
|
||||||
const QString &inputName = formData.value(QSL("inputName")).toString();
|
const QString &inputName = formData.value(QSL("inputName")).toString();
|
||||||
@ -302,7 +302,7 @@ void SearchEnginesManager::addEngineFromForm(const QVariantMap &formData, WebVie
|
|||||||
SearchEngine engine;
|
SearchEngine engine;
|
||||||
engine.name = view->title();
|
engine.name = view->title();
|
||||||
engine.icon = view->icon();
|
engine.icon = view->icon();
|
||||||
engine.url = actionUrl.toEncoded();
|
engine.url = QString::fromUtf8(actionUrl.toEncoded());
|
||||||
|
|
||||||
if (isPost) {
|
if (isPost) {
|
||||||
QByteArray data = parameterUrl.toEncoded(QUrl::RemoveScheme);
|
QByteArray data = parameterUrl.toEncoded(QUrl::RemoveScheme);
|
||||||
@ -316,7 +316,7 @@ void SearchEnginesManager::addEngineFromForm(const QVariantMap &formData, WebVie
|
|||||||
dialog.setName(engine.name);
|
dialog.setName(engine.name);
|
||||||
dialog.setIcon(engine.icon);
|
dialog.setIcon(engine.icon);
|
||||||
dialog.setUrl(engine.url);
|
dialog.setUrl(engine.url);
|
||||||
dialog.setPostData(engine.postData);
|
dialog.setPostData(QString::fromUtf8(engine.postData));
|
||||||
|
|
||||||
if (dialog.exec() != QDialog::Accepted) {
|
if (dialog.exec() != QDialog::Accepted) {
|
||||||
return;
|
return;
|
||||||
@ -341,7 +341,7 @@ void SearchEnginesManager::addEngine(OpenSearchEngine* engine)
|
|||||||
|
|
||||||
Engine en;
|
Engine en;
|
||||||
en.name = engine->name();
|
en.name = engine->name();
|
||||||
en.url = engine->searchUrl("searchstring").toString().replace(QLatin1String("searchstring"), QLatin1String("%s"));
|
en.url = engine->searchUrl(QSL("searchstring")).toString().replace(QLatin1String("searchstring"), QLatin1String("%s"));
|
||||||
|
|
||||||
if (engine->image().isNull()) {
|
if (engine->image().isNull()) {
|
||||||
en.icon = iconForSearchEngine(engine->searchUrl(QString()));
|
en.icon = iconForSearchEngine(engine->searchUrl(QString()));
|
||||||
@ -352,7 +352,7 @@ void SearchEnginesManager::addEngine(OpenSearchEngine* engine)
|
|||||||
|
|
||||||
en.suggestionsUrl = engine->getSuggestionsUrl();
|
en.suggestionsUrl = engine->getSuggestionsUrl();
|
||||||
en.suggestionsParameters = engine->getSuggestionsParameters();
|
en.suggestionsParameters = engine->getSuggestionsParameters();
|
||||||
en.postData = engine->getPostData("searchstring").replace("searchstring", "%s");
|
en.postData = engine->getPostData(QSL("searchstring")).replace("searchstring", "%s");
|
||||||
|
|
||||||
addEngine(en);
|
addEngine(en);
|
||||||
|
|
||||||
@ -449,7 +449,7 @@ void SearchEnginesManager::removeEngine(const Engine &engine)
|
|||||||
}
|
}
|
||||||
|
|
||||||
QSqlQuery query(SqlDatabase::instance()->database());
|
QSqlQuery query(SqlDatabase::instance()->database());
|
||||||
query.prepare("DELETE FROM search_engines WHERE name=? AND url=?");
|
query.prepare(QSL("DELETE FROM search_engines WHERE name=? AND url=?"));
|
||||||
query.bindValue(0, engine.name);
|
query.bindValue(0, engine.name);
|
||||||
query.bindValue(1, engine.url);
|
query.bindValue(1, engine.url);
|
||||||
query.exec();
|
query.exec();
|
||||||
@ -476,9 +476,9 @@ QVector<SearchEngine> SearchEnginesManager::allEngines()
|
|||||||
void SearchEnginesManager::saveSettings()
|
void SearchEnginesManager::saveSettings()
|
||||||
{
|
{
|
||||||
Settings settings;
|
Settings settings;
|
||||||
settings.beginGroup("SearchEngines");
|
settings.beginGroup(QSL("SearchEngines"));
|
||||||
settings.setValue("activeEngine", m_activeEngine.name);
|
settings.setValue(QSL("activeEngine"), m_activeEngine.name);
|
||||||
settings.setValue("DefaultEngine", m_defaultEngine.name);
|
settings.setValue(QSL("DefaultEngine"), m_defaultEngine.name);
|
||||||
settings.endGroup();
|
settings.endGroup();
|
||||||
|
|
||||||
if (!m_saveScheduled) {
|
if (!m_saveScheduled) {
|
||||||
@ -493,10 +493,10 @@ void SearchEnginesManager::saveSettings()
|
|||||||
// But as long as user is not playing with search engines every run it is acceptable.
|
// But as long as user is not playing with search engines every run it is acceptable.
|
||||||
|
|
||||||
QSqlQuery query(SqlDatabase::instance()->database());
|
QSqlQuery query(SqlDatabase::instance()->database());
|
||||||
query.exec("DELETE FROM search_engines");
|
query.exec(QSL("DELETE FROM search_engines"));
|
||||||
|
|
||||||
for (const Engine &en : qAsConst(m_allEngines)) {
|
for (const Engine &en : qAsConst(m_allEngines)) {
|
||||||
query.prepare("INSERT INTO search_engines (name, icon, url, shortcut, suggestionsUrl, suggestionsParameters, postData) VALUES (?, ?, ?, ?, ?, ?, ?)");
|
query.prepare(QSL("INSERT INTO search_engines (name, icon, url, shortcut, suggestionsUrl, suggestionsParameters, postData) VALUES (?, ?, ?, ?, ?, ?, ?)"));
|
||||||
query.addBindValue(en.name);
|
query.addBindValue(en.name);
|
||||||
query.addBindValue(iconToBase64(en.icon));
|
query.addBindValue(iconToBase64(en.icon));
|
||||||
query.addBindValue(en.url);
|
query.addBindValue(en.url);
|
||||||
|
@ -47,17 +47,17 @@ AboutDialog::~AboutDialog()
|
|||||||
void AboutDialog::showAbout()
|
void AboutDialog::showAbout()
|
||||||
{
|
{
|
||||||
QString aboutHtml;
|
QString aboutHtml;
|
||||||
aboutHtml += "<div style='margin:0px 20px;'>";
|
aboutHtml += QSL("<div style='margin:0px 20px;'>");
|
||||||
aboutHtml += tr("<p><b>Application version %1</b><br/>").arg(
|
aboutHtml += tr("<p><b>Application version %1</b><br/>").arg(
|
||||||
#ifdef FALKON_GIT_REVISION
|
#ifdef FALKON_GIT_REVISION
|
||||||
QString("%1 (%2)").arg(Qz::VERSION, FALKON_GIT_REVISION)
|
QString(QSL("%1 (%2)")).arg(QString::fromLatin1(Qz::VERSION), QL1S(FALKON_GIT_REVISION))
|
||||||
#else
|
#else
|
||||||
Qz::VERSION
|
QString::fromLatin1(Qz::VERSION)
|
||||||
#endif
|
#endif
|
||||||
);
|
);
|
||||||
aboutHtml += tr("<b>QtWebEngine version %1</b></p>").arg(QStringLiteral(QTWEBENGINECORE_VERSION_STR));
|
aboutHtml += tr("<b>QtWebEngine version %1</b></p>").arg(QStringLiteral(QTWEBENGINECORE_VERSION_STR));
|
||||||
aboutHtml += QStringLiteral("<p>© %1 %2<br/>").arg(Qz::COPYRIGHT, Qz::AUTHOR);
|
aboutHtml += QStringLiteral("<p>© %1 %2<br/>").arg(QString::fromLatin1(Qz::COPYRIGHT), QString::fromLatin1(Qz::AUTHOR));
|
||||||
aboutHtml += QStringLiteral("<a href=%1>%1</a></p>").arg(Qz::WWWADDRESS);
|
aboutHtml += QStringLiteral("<a href=%1>%1</a></p>").arg(QString::fromLatin1(Qz::WWWADDRESS));
|
||||||
aboutHtml += QStringLiteral("<p>") + mApp->userAgentManager()->defaultUserAgent() + QStringLiteral("</p>");
|
aboutHtml += QStringLiteral("<p>") + mApp->userAgentManager()->defaultUserAgent() + QStringLiteral("</p>");
|
||||||
aboutHtml += QStringLiteral("</div>");
|
aboutHtml += QStringLiteral("</div>");
|
||||||
ui->textLabel->setText(aboutHtml);
|
ui->textLabel->setText(aboutHtml);
|
||||||
|
@ -37,9 +37,9 @@ BrowsingLibrary::BrowsingLibrary(BrowserWindow* window, QWidget* parent)
|
|||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
|
||||||
Settings settings;
|
Settings settings;
|
||||||
settings.beginGroup("BrowsingLibrary");
|
settings.beginGroup(QSL("BrowsingLibrary"));
|
||||||
resize(settings.value("size", QSize(760, 470)).toSize());
|
resize(settings.value(QSL("size"), QSize(760, 470)).toSize());
|
||||||
m_historyManager->restoreState(settings.value("historyState", QByteArray()).toByteArray());
|
m_historyManager->restoreState(settings.value(QSL("historyState"), QByteArray()).toByteArray());
|
||||||
settings.endGroup();
|
settings.endGroup();
|
||||||
|
|
||||||
QzTools::centerWidgetOnScreen(this);
|
QzTools::centerWidgetOnScreen(this);
|
||||||
@ -65,7 +65,7 @@ BrowsingLibrary::BrowsingLibrary(BrowserWindow* window, QWidget* parent)
|
|||||||
connect(ui->tabs, &FancyTabWidget::CurrentChanged, ui->searchLine, &QLineEdit::clear);
|
connect(ui->tabs, &FancyTabWidget::CurrentChanged, ui->searchLine, &QLineEdit::clear);
|
||||||
connect(ui->searchLine, &QLineEdit::textChanged, this, &BrowsingLibrary::search);
|
connect(ui->searchLine, &QLineEdit::textChanged, this, &BrowsingLibrary::search);
|
||||||
|
|
||||||
QzTools::setWmClass("Browsing Library", this);
|
QzTools::setWmClass(QSL("Browsing Library"), this);
|
||||||
}
|
}
|
||||||
|
|
||||||
void BrowsingLibrary::search()
|
void BrowsingLibrary::search()
|
||||||
@ -113,9 +113,9 @@ void BrowsingLibrary::showBookmarks(BrowserWindow* window)
|
|||||||
void BrowsingLibrary::closeEvent(QCloseEvent* e)
|
void BrowsingLibrary::closeEvent(QCloseEvent* e)
|
||||||
{
|
{
|
||||||
Settings settings;
|
Settings settings;
|
||||||
settings.beginGroup("BrowsingLibrary");
|
settings.beginGroup(QSL("BrowsingLibrary"));
|
||||||
settings.setValue("size", size());
|
settings.setValue(QSL("size"), size());
|
||||||
settings.setValue("historyState", m_historyManager->saveState());
|
settings.setValue(QSL("historyState"), m_historyManager->saveState());
|
||||||
settings.endGroup();
|
settings.endGroup();
|
||||||
e->accept();
|
e->accept();
|
||||||
}
|
}
|
||||||
|
@ -54,8 +54,8 @@ ClearPrivateData::ClearPrivateData(QWidget* parent)
|
|||||||
connect(ui->editCookies, &QAbstractButton::clicked, this, &ClearPrivateData::showCookieManager);
|
connect(ui->editCookies, &QAbstractButton::clicked, this, &ClearPrivateData::showCookieManager);
|
||||||
|
|
||||||
Settings settings;
|
Settings settings;
|
||||||
settings.beginGroup("ClearPrivateData");
|
settings.beginGroup(QSL("ClearPrivateData"));
|
||||||
restoreState(settings.value("state", QByteArray()).toByteArray());
|
restoreState(settings.value(QSL("state"), QByteArray()).toByteArray());
|
||||||
settings.endGroup();
|
settings.endGroup();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -91,8 +91,8 @@ void ClearPrivateData::clearCache()
|
|||||||
void ClearPrivateData::closeEvent(QCloseEvent* e)
|
void ClearPrivateData::closeEvent(QCloseEvent* e)
|
||||||
{
|
{
|
||||||
Settings settings;
|
Settings settings;
|
||||||
settings.beginGroup("ClearPrivateData");
|
settings.beginGroup(QSL("ClearPrivateData"));
|
||||||
settings.setValue("state", saveState());
|
settings.setValue(QSL("state"), saveState());
|
||||||
settings.endGroup();
|
settings.endGroup();
|
||||||
|
|
||||||
e->accept();
|
e->accept();
|
||||||
|
@ -38,8 +38,8 @@ IconChooser::IconChooser(QWidget* parent)
|
|||||||
|
|
||||||
void IconChooser::chooseFile()
|
void IconChooser::chooseFile()
|
||||||
{
|
{
|
||||||
const QString fileTypes = QString("%3(*.png *.jpg *.jpeg *.gif)").arg(tr("Image files"));
|
const QString fileTypes = QSL("%3(*.png *.jpg *.jpeg *.gif)").arg(tr("Image files"));
|
||||||
const QString path = QzTools::getOpenFileName("IconChooser-ChangeIcon", this, tr("Choose icon..."), QDir::homePath(), fileTypes);
|
const QString path = QzTools::getOpenFileName(QSL("IconChooser-ChangeIcon"), this, tr("Choose icon..."), QDir::homePath(), fileTypes);
|
||||||
|
|
||||||
if (path.isEmpty()) {
|
if (path.isEmpty()) {
|
||||||
return;
|
return;
|
||||||
|
@ -32,7 +32,7 @@ LicenseViewer::LicenseViewer(QWidget* parent)
|
|||||||
m_textBrowser = new QTextBrowser(this);
|
m_textBrowser = new QTextBrowser(this);
|
||||||
|
|
||||||
QFont serifFont = m_textBrowser->font();
|
QFont serifFont = m_textBrowser->font();
|
||||||
serifFont.setFamily("Courier");
|
serifFont.setFamily(QSL("Courier"));
|
||||||
m_textBrowser->setFont(serifFont);
|
m_textBrowser->setFont(serifFont);
|
||||||
|
|
||||||
auto* buttonBox = new QDialogButtonBox(this);
|
auto* buttonBox = new QDialogButtonBox(this);
|
||||||
|
@ -26,52 +26,52 @@ QzSettings::QzSettings()
|
|||||||
void QzSettings::loadSettings()
|
void QzSettings::loadSettings()
|
||||||
{
|
{
|
||||||
Settings settings;
|
Settings settings;
|
||||||
settings.beginGroup("AddressBar");
|
settings.beginGroup(QSL("AddressBar"));
|
||||||
selectAllOnDoubleClick = settings.value("SelectAllTextOnDoubleClick", true).toBool();
|
selectAllOnDoubleClick = settings.value(QSL("SelectAllTextOnDoubleClick"), true).toBool();
|
||||||
selectAllOnClick = settings.value("SelectAllTextOnClick", false).toBool();
|
selectAllOnClick = settings.value(QSL("SelectAllTextOnClick"), false).toBool();
|
||||||
showLoadingProgress = settings.value("ShowLoadingProgress", false).toBool();
|
showLoadingProgress = settings.value(QSL("ShowLoadingProgress"), false).toBool();
|
||||||
showLocationSuggestions = settings.value("showSuggestions", 0).toInt();
|
showLocationSuggestions = settings.value(QSL("showSuggestions"), 0).toInt();
|
||||||
showSwitchTab = settings.value("showSwitchTab", true).toBool();
|
showSwitchTab = settings.value(QSL("showSwitchTab"), true).toBool();
|
||||||
alwaysShowGoIcon = settings.value("alwaysShowGoIcon", false).toBool();
|
alwaysShowGoIcon = settings.value(QSL("alwaysShowGoIcon"), false).toBool();
|
||||||
useInlineCompletion = settings.value("useInlineCompletion", true).toBool();
|
useInlineCompletion = settings.value(QSL("useInlineCompletion"), true).toBool();
|
||||||
showZoomLabel = settings.value("showZoomLabel", true).toBool();
|
showZoomLabel = settings.value(QSL("showZoomLabel"), true).toBool();
|
||||||
completionPopupExpandToWindow = settings.value("CompletionPopupExpandToWindow", false).toBool();
|
completionPopupExpandToWindow = settings.value(QSL("CompletionPopupExpandToWindow"), false).toBool();
|
||||||
settings.endGroup();
|
settings.endGroup();
|
||||||
|
|
||||||
settings.beginGroup("SearchEngines");
|
settings.beginGroup(QSL("SearchEngines"));
|
||||||
searchOnEngineChange = settings.value("SearchOnEngineChange", true).toBool();
|
searchOnEngineChange = settings.value(QSL("SearchOnEngineChange"), true).toBool();
|
||||||
searchFromAddressBar = settings.value("SearchFromAddressBar", true).toBool();
|
searchFromAddressBar = settings.value(QSL("SearchFromAddressBar"), true).toBool();
|
||||||
searchWithDefaultEngine = settings.value("SearchWithDefaultEngine", true).toBool();
|
searchWithDefaultEngine = settings.value(QSL("SearchWithDefaultEngine"), true).toBool();
|
||||||
showABSearchSuggestions = settings.value("showSearchSuggestions", true).toBool();
|
showABSearchSuggestions = settings.value(QSL("showSearchSuggestions"), true).toBool();
|
||||||
showWSBSearchSuggestions = settings.value("showSuggestions", true).toBool();
|
showWSBSearchSuggestions = settings.value(QSL("showSuggestions"), true).toBool();
|
||||||
settings.endGroup();
|
settings.endGroup();
|
||||||
|
|
||||||
settings.beginGroup("Web-Browser-Settings");
|
settings.beginGroup(QSL("Web-Browser-Settings"));
|
||||||
defaultZoomLevel = settings.value("DefaultZoomLevel", WebView::zoomLevels().indexOf(100)).toInt();
|
defaultZoomLevel = settings.value(QSL("DefaultZoomLevel"), WebView::zoomLevels().indexOf(100)).toInt();
|
||||||
loadTabsOnActivation = settings.value("LoadTabsOnActivation", true).toBool();
|
loadTabsOnActivation = settings.value(QSL("LoadTabsOnActivation"), true).toBool();
|
||||||
autoOpenProtocols = settings.value("AutomaticallyOpenProtocols", QStringList()).toStringList();
|
autoOpenProtocols = settings.value(QSL("AutomaticallyOpenProtocols"), QStringList()).toStringList();
|
||||||
blockedProtocols = settings.value("BlockOpeningProtocols", QStringList()).toStringList();
|
blockedProtocols = settings.value(QSL("BlockOpeningProtocols"), QStringList()).toStringList();
|
||||||
allowedSchemes = settings.value("AllowedSchemes", QStringList()).toStringList();
|
allowedSchemes = settings.value(QSL("AllowedSchemes"), QStringList()).toStringList();
|
||||||
blockedSchemes = settings.value("BlockedSchemes", QStringList()).toStringList();
|
blockedSchemes = settings.value(QSL("BlockedSchemes"), QStringList()).toStringList();
|
||||||
settings.endGroup();
|
settings.endGroup();
|
||||||
|
|
||||||
settings.beginGroup("Browser-Tabs-Settings");
|
settings.beginGroup(QSL("Browser-Tabs-Settings"));
|
||||||
newTabPosition = settings.value("OpenNewTabsSelected", false).toBool() ? Qz::NT_CleanSelectedTab : Qz::NT_CleanNotSelectedTab;
|
newTabPosition = settings.value(QSL("OpenNewTabsSelected"), false).toBool() ? Qz::NT_CleanSelectedTab : Qz::NT_CleanNotSelectedTab;
|
||||||
tabsOnTop = settings.value("TabsOnTop", true).toBool();
|
tabsOnTop = settings.value(QSL("TabsOnTop"), true).toBool();
|
||||||
openPopupsInTabs = settings.value("OpenPopupsInTabs", false).toBool();
|
openPopupsInTabs = settings.value(QSL("OpenPopupsInTabs"), false).toBool();
|
||||||
alwaysSwitchTabsWithWheel = settings.value("AlwaysSwitchTabsWithWheel", false).toBool();
|
alwaysSwitchTabsWithWheel = settings.value(QSL("AlwaysSwitchTabsWithWheel"), false).toBool();
|
||||||
settings.endGroup();
|
settings.endGroup();
|
||||||
}
|
}
|
||||||
|
|
||||||
void QzSettings::saveSettings()
|
void QzSettings::saveSettings()
|
||||||
{
|
{
|
||||||
Settings settings;
|
Settings settings;
|
||||||
settings.beginGroup("Web-Browser-Settings");
|
settings.beginGroup(QSL("Web-Browser-Settings"));
|
||||||
settings.setValue("AutomaticallyOpenProtocols", autoOpenProtocols);
|
settings.setValue(QSL("AutomaticallyOpenProtocols"), autoOpenProtocols);
|
||||||
settings.setValue("BlockOpeningProtocols", blockedProtocols);
|
settings.setValue(QSL("BlockOpeningProtocols"), blockedProtocols);
|
||||||
settings.endGroup();
|
settings.endGroup();
|
||||||
|
|
||||||
settings.beginGroup("Browser-Tabs-Settings");
|
settings.beginGroup(QSL("Browser-Tabs-Settings"));
|
||||||
settings.setValue("TabsOnTop", tabsOnTop);
|
settings.setValue(QSL("TabsOnTop"), tabsOnTop);
|
||||||
settings.endGroup();
|
settings.endGroup();
|
||||||
}
|
}
|
||||||
|
@ -79,16 +79,16 @@ void RegisterQAppAssociation::setAppInfo(const QString &appRegisteredName, const
|
|||||||
|
|
||||||
bool RegisterQAppAssociation::isPerMachineRegisteration()
|
bool RegisterQAppAssociation::isPerMachineRegisteration()
|
||||||
{
|
{
|
||||||
return (_UserRootKey == "HKEY_LOCAL_MACHINE");
|
return (_UserRootKey == QSL("HKEY_LOCAL_MACHINE"));
|
||||||
}
|
}
|
||||||
|
|
||||||
void RegisterQAppAssociation::setPerMachineRegisteration(bool enable)
|
void RegisterQAppAssociation::setPerMachineRegisteration(bool enable)
|
||||||
{
|
{
|
||||||
if (enable) {
|
if (enable) {
|
||||||
_UserRootKey = "HKEY_LOCAL_MACHINE";
|
_UserRootKey = QSL("HKEY_LOCAL_MACHINE");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
_UserRootKey = "HKEY_CURRENT_USER";
|
_UserRootKey = QSL("HKEY_CURRENT_USER");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -98,13 +98,13 @@ bool RegisterQAppAssociation::registerAppCapabilities()
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
// Vista and newer
|
// Vista and newer
|
||||||
QSettings regLocalMachine("HKEY_LOCAL_MACHINE", QSettings::NativeFormat);
|
QSettings regLocalMachine(QSL("HKEY_LOCAL_MACHINE"), QSettings::NativeFormat);
|
||||||
QString capabilitiesKey = regLocalMachine.value("Software/RegisteredApplications/" + _appRegisteredName).toString();
|
QString capabilitiesKey = regLocalMachine.value(QSL("Software/RegisteredApplications/") + _appRegisteredName).toString();
|
||||||
|
|
||||||
if (capabilitiesKey.isEmpty()) {
|
if (capabilitiesKey.isEmpty()) {
|
||||||
regLocalMachine.setValue("Software/RegisteredApplications/" + _appRegisteredName,
|
regLocalMachine.setValue(QSL("Software/RegisteredApplications/") + _appRegisteredName,
|
||||||
QString("Software\\" + _appRegisteredName + "\\Capabilities"));
|
QString(QSL("Software\\") + _appRegisteredName + QSL("\\Capabilities")));
|
||||||
capabilitiesKey = regLocalMachine.value("Software/RegisteredApplications/" + _appRegisteredName).toString();
|
capabilitiesKey = regLocalMachine.value(QSL("Software/RegisteredApplications/") + _appRegisteredName).toString();
|
||||||
|
|
||||||
if (capabilitiesKey.isEmpty()) {
|
if (capabilitiesKey.isEmpty()) {
|
||||||
QMessageBox::warning(mApp->getWindow(), tr("Warning!"),
|
QMessageBox::warning(mApp->getWindow(), tr("Warning!"),
|
||||||
@ -114,7 +114,7 @@ bool RegisterQAppAssociation::registerAppCapabilities()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
capabilitiesKey.replace("\\", "/");
|
capabilitiesKey.replace(QSL("\\"), QSL("/"));
|
||||||
|
|
||||||
QHash<QString, QPair<QString, QString> >::const_iterator it = _assocDescHash.constBegin();
|
QHash<QString, QPair<QString, QString> >::const_iterator it = _assocDescHash.constBegin();
|
||||||
while (it != _assocDescHash.constEnd()) {
|
while (it != _assocDescHash.constEnd()) {
|
||||||
@ -122,22 +122,22 @@ bool RegisterQAppAssociation::registerAppCapabilities()
|
|||||||
++it;
|
++it;
|
||||||
}
|
}
|
||||||
|
|
||||||
regLocalMachine.setValue(capabilitiesKey + "/ApplicationDescription", _appDesc);
|
regLocalMachine.setValue(capabilitiesKey + QSL("/ApplicationDescription"), _appDesc);
|
||||||
regLocalMachine.setValue(capabilitiesKey + "/ApplicationIcon", _appIcon);
|
regLocalMachine.setValue(capabilitiesKey + QSL("/ApplicationIcon"), _appIcon);
|
||||||
regLocalMachine.setValue(capabilitiesKey + "/ApplicationName", _appRegisteredName);
|
regLocalMachine.setValue(capabilitiesKey + QSL("/ApplicationName"), _appRegisteredName);
|
||||||
|
|
||||||
QHash<QString, QString>::const_iterator i = _fileAssocHash.constBegin();
|
QHash<QString, QString>::const_iterator i = _fileAssocHash.constBegin();
|
||||||
while (i != _fileAssocHash.constEnd()) {
|
while (i != _fileAssocHash.constEnd()) {
|
||||||
regLocalMachine.setValue(capabilitiesKey + "/FileAssociations/" + i.key(), i.value());
|
regLocalMachine.setValue(capabilitiesKey + QSL("/FileAssociations/") + i.key(), i.value());
|
||||||
++i;
|
++i;
|
||||||
}
|
}
|
||||||
|
|
||||||
i = _urlAssocHash.constBegin();
|
i = _urlAssocHash.constBegin();
|
||||||
while (i != _urlAssocHash.constEnd()) {
|
while (i != _urlAssocHash.constEnd()) {
|
||||||
regLocalMachine.setValue(capabilitiesKey + "/URLAssociations/" + i.key(), i.value());
|
regLocalMachine.setValue(capabilitiesKey + QSL("/URLAssociations/") + i.key(), i.value());
|
||||||
++i;
|
++i;
|
||||||
}
|
}
|
||||||
regLocalMachine.setValue(capabilitiesKey + "/Startmenu/StartMenuInternet", _appPath);
|
regLocalMachine.setValue(capabilitiesKey + QSL("/Startmenu/StartMenuInternet"), _appPath);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -173,10 +173,10 @@ void RegisterQAppAssociation::registerAssociation(const QString &assocName, Asso
|
|||||||
AT_FILEEXTENSION);
|
AT_FILEEXTENSION);
|
||||||
break;
|
break;
|
||||||
case UrlAssociation: {
|
case UrlAssociation: {
|
||||||
QSettings regCurrentUserRoot("HKEY_CURRENT_USER", QSettings::NativeFormat);
|
QSettings regCurrentUserRoot(QSL("HKEY_CURRENT_USER"), QSettings::NativeFormat);
|
||||||
QString currentUrlDefault =
|
QString currentUrlDefault =
|
||||||
regCurrentUserRoot.value("Software/Microsoft/Windows/Shell/Associations/UrlAssociations/"
|
regCurrentUserRoot.value(QSL("Software/Microsoft/Windows/Shell/Associations/UrlAssociations/")
|
||||||
+ assocName + "/UserChoice/Progid").toString();
|
+ assocName + QSL("/UserChoice/Progid")).toString();
|
||||||
hr = pAAR->SetAppAsDefault(_appRegisteredName.toStdWString().c_str(),
|
hr = pAAR->SetAppAsDefault(_appRegisteredName.toStdWString().c_str(),
|
||||||
assocName.toStdWString().c_str(),
|
assocName.toStdWString().c_str(),
|
||||||
AT_URLPROTOCOL);
|
AT_URLPROTOCOL);
|
||||||
@ -184,9 +184,9 @@ void RegisterQAppAssociation::registerAssociation(const QString &assocName, Asso
|
|||||||
!currentUrlDefault.isEmpty() &&
|
!currentUrlDefault.isEmpty() &&
|
||||||
currentUrlDefault != _urlAssocHash.value(assocName)
|
currentUrlDefault != _urlAssocHash.value(assocName)
|
||||||
) {
|
) {
|
||||||
regCurrentUserRoot.setValue("Software/Classes"
|
regCurrentUserRoot.setValue(QSL("Software/Classes")
|
||||||
+ assocName
|
+ assocName
|
||||||
+ "/shell/open/command/backup_progid", currentUrlDefault);
|
+ QSL("/shell/open/command/backup_progid"), currentUrlDefault);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -201,36 +201,36 @@ void RegisterQAppAssociation::registerAssociation(const QString &assocName, Asso
|
|||||||
}
|
}
|
||||||
else { // Older than Vista
|
else { // Older than Vista
|
||||||
QSettings regUserRoot(_UserRootKey, QSettings::NativeFormat);
|
QSettings regUserRoot(_UserRootKey, QSettings::NativeFormat);
|
||||||
regUserRoot.beginGroup("Software/Classes");
|
regUserRoot.beginGroup(QSL("Software/Classes"));
|
||||||
QSettings regClassesRoot("HKEY_CLASSES_ROOT", QSettings::NativeFormat);
|
QSettings regClassesRoot(QSL("HKEY_CLASSES_ROOT"), QSettings::NativeFormat);
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case FileAssociation: {
|
case FileAssociation: {
|
||||||
QString progId = _fileAssocHash.value(assocName);
|
QString progId = _fileAssocHash.value(assocName);
|
||||||
createProgId(progId);
|
createProgId(progId);
|
||||||
QString currentDefault = regClassesRoot.value(assocName + "/Default").toString();
|
QString currentDefault = regClassesRoot.value(assocName + QSL("/Default")).toString();
|
||||||
if (!currentDefault.isEmpty() &&
|
if (!currentDefault.isEmpty() &&
|
||||||
currentDefault != progId &&
|
currentDefault != progId &&
|
||||||
regUserRoot.value(assocName + "/backup_val").toString() != progId
|
regUserRoot.value(assocName + QSL("/backup_val")).toString() != progId
|
||||||
) {
|
) {
|
||||||
regUserRoot.setValue(assocName + "/backup_val", currentDefault);
|
regUserRoot.setValue(assocName + QSL("/backup_val"), currentDefault);
|
||||||
}
|
}
|
||||||
regUserRoot.setValue(assocName + "/.", progId);
|
regUserRoot.setValue(assocName + QSL("/."), progId);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case UrlAssociation: {
|
case UrlAssociation: {
|
||||||
QString progId = _urlAssocHash.value(assocName);
|
QString progId = _urlAssocHash.value(assocName);
|
||||||
createProgId(progId);
|
createProgId(progId);
|
||||||
QString currentDefault = regClassesRoot.value(assocName + "/shell/open/command/Default").toString();
|
QString currentDefault = regClassesRoot.value(assocName + QSL("/shell/open/command/Default")).toString();
|
||||||
QString command = "\"" + _appPath + "\" \"%1\"";
|
QString command = QSL("\"") + _appPath + QSL("\" \"%1\"");
|
||||||
if (!currentDefault.isEmpty() &&
|
if (!currentDefault.isEmpty() &&
|
||||||
currentDefault != command &&
|
currentDefault != command &&
|
||||||
regUserRoot.value(assocName + "/shell/open/command/backup_val").toString() != command
|
regUserRoot.value(assocName + QSL("/shell/open/command/backup_val")).toString() != command
|
||||||
) {
|
) {
|
||||||
regUserRoot.setValue(assocName + "/shell/open/command/backup_val", currentDefault);
|
regUserRoot.setValue(assocName + QSL("/shell/open/command/backup_val"), currentDefault);
|
||||||
}
|
}
|
||||||
|
|
||||||
regUserRoot.setValue(assocName + "/shell/open/command/.", command);
|
regUserRoot.setValue(assocName + QSL("/shell/open/command/."), command);
|
||||||
regUserRoot.setValue(assocName + "/URL Protocol", "");
|
regUserRoot.setValue(assocName + QSL("/URL Protocol"), QSL(""));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
@ -325,25 +325,25 @@ bool RegisterQAppAssociation::showNativeDefaultAppSettingsUi()
|
|||||||
void RegisterQAppAssociation::createProgId(const QString &progId)
|
void RegisterQAppAssociation::createProgId(const QString &progId)
|
||||||
{
|
{
|
||||||
QSettings regUserRoot(_UserRootKey, QSettings::NativeFormat);
|
QSettings regUserRoot(_UserRootKey, QSettings::NativeFormat);
|
||||||
regUserRoot.beginGroup("Software/Classes");
|
regUserRoot.beginGroup(QSL("Software/Classes"));
|
||||||
QPair<QString, QString> pair = _assocDescHash.value(progId);
|
QPair<QString, QString> pair = _assocDescHash.value(progId);
|
||||||
regUserRoot.setValue(progId + "/.", pair.first);
|
regUserRoot.setValue(progId + QSL("/."), pair.first);
|
||||||
regUserRoot.setValue(progId + "/shell/.", "open");
|
regUserRoot.setValue(progId + QSL("/shell/."), QSL("open"));
|
||||||
regUserRoot.setValue(progId + "/DefaultIcon/.", pair.second);
|
regUserRoot.setValue(progId + QSL("/DefaultIcon/."), pair.second);
|
||||||
regUserRoot.setValue(progId + "/shell/open/command/.", QString("\"" + _appPath + "\" \"%1\""));
|
regUserRoot.setValue(progId + QSL("/shell/open/command/."), QString(QSL("\"") + _appPath + QSL("\" \"%1\"")));
|
||||||
regUserRoot.endGroup();
|
regUserRoot.endGroup();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool RegisterQAppAssociation::isDefaultApp(const QString &assocName, AssociationType type)
|
bool RegisterQAppAssociation::isDefaultApp(const QString &assocName, AssociationType type)
|
||||||
{
|
{
|
||||||
if (isVistaOrNewer()) {
|
if (isVistaOrNewer()) {
|
||||||
QSettings regCurrentUserRoot("HKEY_CURRENT_USER", QSettings::NativeFormat);
|
QSettings regCurrentUserRoot(QSL("HKEY_CURRENT_USER"), QSettings::NativeFormat);
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case FileAssociation: {
|
case FileAssociation: {
|
||||||
regCurrentUserRoot.beginGroup("Software/Microsoft/Windows/CurrentVersion/Explorer/FileExts");
|
regCurrentUserRoot.beginGroup(QSL("Software/Microsoft/Windows/CurrentVersion/Explorer/FileExts"));
|
||||||
if (regCurrentUserRoot.childGroups().contains(assocName, Qt::CaseInsensitive)) {
|
if (regCurrentUserRoot.childGroups().contains(assocName, Qt::CaseInsensitive)) {
|
||||||
return (_fileAssocHash.value(assocName)
|
return (_fileAssocHash.value(assocName)
|
||||||
== regCurrentUserRoot.value(assocName + "/UserChoice/Progid"));
|
== regCurrentUserRoot.value(assocName + QSL("/UserChoice/Progid")));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
regCurrentUserRoot.endGroup();
|
regCurrentUserRoot.endGroup();
|
||||||
@ -352,10 +352,10 @@ bool RegisterQAppAssociation::isDefaultApp(const QString &assocName, Association
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case UrlAssociation: {
|
case UrlAssociation: {
|
||||||
regCurrentUserRoot.beginGroup("Software/Microsoft/Windows/Shell/Associations/UrlAssociations");
|
regCurrentUserRoot.beginGroup(QSL("Software/Microsoft/Windows/Shell/Associations/UrlAssociations"));
|
||||||
if (regCurrentUserRoot.childGroups().contains(assocName, Qt::CaseInsensitive)) {
|
if (regCurrentUserRoot.childGroups().contains(assocName, Qt::CaseInsensitive)) {
|
||||||
return (_urlAssocHash.value(assocName)
|
return (_urlAssocHash.value(assocName)
|
||||||
== regCurrentUserRoot.value(assocName + "/UserChoice/Progid"));
|
== regCurrentUserRoot.value(assocName + QSL("/UserChoice/Progid")));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
regCurrentUserRoot.endGroup();
|
regCurrentUserRoot.endGroup();
|
||||||
@ -369,7 +369,7 @@ bool RegisterQAppAssociation::isDefaultApp(const QString &assocName, Association
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
QSettings regClassesRoot("HKEY_CLASSES_ROOT", QSettings::NativeFormat);
|
QSettings regClassesRoot(QSL("HKEY_CLASSES_ROOT"), QSettings::NativeFormat);
|
||||||
{
|
{
|
||||||
if (!regClassesRoot.childGroups().contains(assocName, Qt::CaseInsensitive)) {
|
if (!regClassesRoot.childGroups().contains(assocName, Qt::CaseInsensitive)) {
|
||||||
return false;
|
return false;
|
||||||
@ -378,13 +378,13 @@ bool RegisterQAppAssociation::isDefaultApp(const QString &assocName, Association
|
|||||||
switch (type) {
|
switch (type) {
|
||||||
case FileAssociation: {
|
case FileAssociation: {
|
||||||
return (_fileAssocHash.value(assocName)
|
return (_fileAssocHash.value(assocName)
|
||||||
== regClassesRoot.value(assocName + "/Default"));
|
== regClassesRoot.value(assocName + QSL("/Default")));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case UrlAssociation: {
|
case UrlAssociation: {
|
||||||
QString currentDefault = regClassesRoot.value(assocName + "/shell/open/command/Default").toString();
|
QString currentDefault = regClassesRoot.value(assocName + QSL("/shell/open/command/Default")).toString();
|
||||||
currentDefault.remove("\"");
|
currentDefault.remove(QSL("\""));
|
||||||
currentDefault.remove("%1");
|
currentDefault.remove(QSL("%1"));
|
||||||
currentDefault = currentDefault.trimmed();
|
currentDefault = currentDefault.trimmed();
|
||||||
return (_appPath == currentDefault);
|
return (_appPath == currentDefault);
|
||||||
}
|
}
|
||||||
|
@ -56,12 +56,12 @@ SiteInfo::SiteInfo(WebView *view)
|
|||||||
delegate->setUniformItemSizes(true);
|
delegate->setUniformItemSizes(true);
|
||||||
ui->listWidget->setItemDelegate(delegate);
|
ui->listWidget->setItemDelegate(delegate);
|
||||||
|
|
||||||
ui->listWidget->item(0)->setIcon(QIcon::fromTheme("document-properties", QIcon(":/icons/preferences/document-properties.png")));
|
ui->listWidget->item(0)->setIcon(QIcon::fromTheme(QSL("document-properties"), QIcon(QSL(":/icons/preferences/document-properties.png"))));
|
||||||
ui->listWidget->item(1)->setIcon(QIcon::fromTheme("applications-graphics", QIcon(":/icons/preferences/applications-graphics.png")));
|
ui->listWidget->item(1)->setIcon(QIcon::fromTheme(QSL("applications-graphics"), QIcon(QSL(":/icons/preferences/applications-graphics.png"))));
|
||||||
ui->listWidget->item(0)->setSelected(true);
|
ui->listWidget->item(0)->setSelected(true);
|
||||||
|
|
||||||
// General
|
// General
|
||||||
ui->heading->setText(QString("<b>%1</b>:").arg(m_view->title()));
|
ui->heading->setText(QSL("<b>%1</b>:").arg(m_view->title()));
|
||||||
ui->siteAddress->setText(m_view->url().toString());
|
ui->siteAddress->setText(m_view->url().toString());
|
||||||
|
|
||||||
if (m_view->url().scheme() == QL1S("https"))
|
if (m_view->url().scheme() == QL1S("https"))
|
||||||
@ -128,19 +128,19 @@ SiteInfo::SiteInfo(WebView *view)
|
|||||||
connect(ui->treeImages, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(imagesCustomContextMenuRequested(QPoint)));
|
connect(ui->treeImages, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(imagesCustomContextMenuRequested(QPoint)));
|
||||||
connect(ui->treeTags, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(tagsCustomContextMenuRequested(QPoint)));
|
connect(ui->treeTags, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(tagsCustomContextMenuRequested(QPoint)));
|
||||||
|
|
||||||
auto *shortcutTagsCopyAll = new QShortcut(QKeySequence("Ctrl+C"), ui->treeTags);
|
auto *shortcutTagsCopyAll = new QShortcut(QKeySequence(QSL("Ctrl+C")), ui->treeTags);
|
||||||
shortcutTagsCopyAll->setContext(Qt::WidgetShortcut);
|
shortcutTagsCopyAll->setContext(Qt::WidgetShortcut);
|
||||||
connect(shortcutTagsCopyAll, &QShortcut::activated, [=]{copySelectedItems(ui->treeTags, false);});
|
connect(shortcutTagsCopyAll, &QShortcut::activated, [=]{copySelectedItems(ui->treeTags, false);});
|
||||||
|
|
||||||
auto *shortcutTagsCopyValues = new QShortcut(QKeySequence("Ctrl+Shift+C"), ui->treeTags);
|
auto *shortcutTagsCopyValues = new QShortcut(QKeySequence(QSL("Ctrl+Shift+C")), ui->treeTags);
|
||||||
shortcutTagsCopyValues->setContext(Qt::WidgetShortcut);
|
shortcutTagsCopyValues->setContext(Qt::WidgetShortcut);
|
||||||
connect(shortcutTagsCopyValues, &QShortcut::activated, [=]{copySelectedItems(ui->treeTags, true);});
|
connect(shortcutTagsCopyValues, &QShortcut::activated, [=]{copySelectedItems(ui->treeTags, true);});
|
||||||
|
|
||||||
auto *shortcutImagesCopyAll = new QShortcut(QKeySequence("Ctrl+C"), ui->treeImages);
|
auto *shortcutImagesCopyAll = new QShortcut(QKeySequence(QSL("Ctrl+C")), ui->treeImages);
|
||||||
shortcutImagesCopyAll->setContext(Qt::WidgetShortcut);
|
shortcutImagesCopyAll->setContext(Qt::WidgetShortcut);
|
||||||
connect(shortcutImagesCopyAll, &QShortcut::activated, [=]{copySelectedItems(ui->treeImages, false);});
|
connect(shortcutImagesCopyAll, &QShortcut::activated, [=]{copySelectedItems(ui->treeImages, false);});
|
||||||
|
|
||||||
auto *shortcutImagesCopyValues = new QShortcut(QKeySequence("Ctrl+Shift+C"), ui->treeImages);
|
auto *shortcutImagesCopyValues = new QShortcut(QKeySequence(QSL("Ctrl+Shift+C")), ui->treeImages);
|
||||||
shortcutImagesCopyValues->setContext(Qt::WidgetShortcut);
|
shortcutImagesCopyValues->setContext(Qt::WidgetShortcut);
|
||||||
connect(shortcutImagesCopyValues, &QShortcut::activated, [=]{copySelectedItems(ui->treeImages, true);});
|
connect(shortcutImagesCopyValues, &QShortcut::activated, [=]{copySelectedItems(ui->treeImages, true);});
|
||||||
|
|
||||||
@ -150,7 +150,7 @@ SiteInfo::SiteInfo(WebView *view)
|
|||||||
ui->treeTags->setContextMenuPolicy(Qt::CustomContextMenu);
|
ui->treeTags->setContextMenuPolicy(Qt::CustomContextMenu);
|
||||||
ui->treeTags->sortByColumn(-1, Qt::AscendingOrder);
|
ui->treeTags->sortByColumn(-1, Qt::AscendingOrder);
|
||||||
|
|
||||||
QzTools::setWmClass("Site Info", this);
|
QzTools::setWmClass(QSL("Site Info"), this);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SiteInfo::canShowSiteInfo(const QUrl &url)
|
bool SiteInfo::canShowSiteInfo(const QUrl &url)
|
||||||
@ -172,10 +172,10 @@ void SiteInfo::imagesCustomContextMenuRequested(const QPoint &p)
|
|||||||
}
|
}
|
||||||
|
|
||||||
QMenu menu;
|
QMenu menu;
|
||||||
menu.addAction(QIcon::fromTheme("edit-copy"), tr("Copy Image Location"), this, [=]{copySelectedItems(ui->treeImages, false);}, QKeySequence("Ctrl+C"));
|
menu.addAction(QIcon::fromTheme(QSL("edit-copy")), tr("Copy Image Location"), this, [=]{copySelectedItems(ui->treeImages, false);}, QKeySequence(QSL("Ctrl+C")));
|
||||||
menu.addAction(tr("Copy Image Name"), this, [=]{copySelectedItems(ui->treeImages, true);}, QKeySequence("Ctrl+Shift+C"));
|
menu.addAction(tr("Copy Image Name"), this, [=]{copySelectedItems(ui->treeImages, true);}, QKeySequence(QSL("Ctrl+Shift+C")));
|
||||||
menu.addSeparator();
|
menu.addSeparator();
|
||||||
menu.addAction(QIcon::fromTheme("document-save"), tr("Save Image to Disk"), this, SLOT(saveImage()));
|
menu.addAction(QIcon::fromTheme(QSL("document-save")), tr("Save Image to Disk"), this, SLOT(saveImage()));
|
||||||
menu.exec(ui->treeImages->viewport()->mapToGlobal(p));
|
menu.exec(ui->treeImages->viewport()->mapToGlobal(p));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -187,8 +187,8 @@ void SiteInfo::tagsCustomContextMenuRequested(const QPoint &p)
|
|||||||
}
|
}
|
||||||
|
|
||||||
QMenu menu;
|
QMenu menu;
|
||||||
menu.addAction(tr("Copy Values"), this, [=]{copySelectedItems(ui->treeTags, false);}, QKeySequence("Ctrl+C"));
|
menu.addAction(tr("Copy Values"), this, [=]{copySelectedItems(ui->treeTags, false);}, QKeySequence(QSL("Ctrl+C")));
|
||||||
menu.addAction(tr("Copy Tags and Values"), this, [=]{copySelectedItems(ui->treeTags, true);}, QKeySequence("Ctrl+Shift+C"));
|
menu.addAction(tr("Copy Tags and Values"), this, [=]{copySelectedItems(ui->treeTags, true);}, QKeySequence(QSL("Ctrl+Shift+C")));
|
||||||
menu.exec(ui->treeTags->viewport()->mapToGlobal(p));
|
menu.exec(ui->treeTags->viewport()->mapToGlobal(p));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -237,7 +237,7 @@ void SiteInfo::saveImage()
|
|||||||
imageFileName.append(QL1S(".png"));
|
imageFileName.append(QL1S(".png"));
|
||||||
}
|
}
|
||||||
|
|
||||||
QString filePath = QzTools::getSaveFileName("SiteInfo-DownloadImage", this, tr("Save image..."),
|
QString filePath = QzTools::getSaveFileName(QSL("SiteInfo-DownloadImage"), this, tr("Save image..."),
|
||||||
QDir::homePath() + QDir::separator() + imageFileName,
|
QDir::homePath() + QDir::separator() + imageFileName,
|
||||||
QSL("*.png"));
|
QSL("*.png"));
|
||||||
if (filePath.isEmpty()) {
|
if (filePath.isEmpty()) {
|
||||||
|
@ -43,33 +43,33 @@ SiteInfoWidget::SiteInfoWidget(BrowserWindow* window, QWidget* parent)
|
|||||||
|
|
||||||
if (view->url().scheme() == QL1S("https")) {
|
if (view->url().scheme() == QL1S("https")) {
|
||||||
ui->secureLabel->setText(tr("Your connection to this site is <b>secured</b>."));
|
ui->secureLabel->setText(tr("Your connection to this site is <b>secured</b>."));
|
||||||
ui->secureIcon->setPixmap(QPixmap(":/icons/locationbar/safe.png"));
|
ui->secureIcon->setPixmap(QPixmap(QSL(":/icons/locationbar/safe.png")));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
ui->secureLabel->setText(tr("Your connection to this site is <b>unsecured</b>."));
|
ui->secureLabel->setText(tr("Your connection to this site is <b>unsecured</b>."));
|
||||||
ui->secureIcon->setPixmap(QPixmap(":/icons/locationbar/unsafe.png"));
|
ui->secureIcon->setPixmap(QPixmap(QSL(":/icons/locationbar/unsafe.png")));
|
||||||
}
|
}
|
||||||
|
|
||||||
QString scheme = view->url().scheme();
|
QString scheme = view->url().scheme();
|
||||||
QString host = view->url().host();
|
QString host = view->url().host();
|
||||||
|
|
||||||
QSqlQuery query(SqlDatabase::instance()->database());
|
QSqlQuery query(SqlDatabase::instance()->database());
|
||||||
query.prepare("SELECT sum(count) FROM history WHERE url LIKE ?");
|
query.prepare(QSL("SELECT sum(count) FROM history WHERE url LIKE ?"));
|
||||||
query.addBindValue(QString("%1://%2%").arg(scheme, host));
|
query.addBindValue(QSL("%1://%2%").arg(scheme, host));
|
||||||
query.exec();
|
query.exec();
|
||||||
|
|
||||||
if (query.next()) {
|
if (query.next()) {
|
||||||
int count = query.value(0).toInt();
|
int count = query.value(0).toInt();
|
||||||
if (count > 3) {
|
if (count > 3) {
|
||||||
ui->historyLabel->setText(tr("This is your <b>%1</b> visit of this site.").arg(QString::number(count) + QLatin1Char('.')));
|
ui->historyLabel->setText(tr("This is your <b>%1</b> visit of this site.").arg(QString::number(count) + QLatin1Char('.')));
|
||||||
ui->historyIcon->setPixmap(QPixmap(":/icons/locationbar/visit3.png"));
|
ui->historyIcon->setPixmap(QPixmap(QSL(":/icons/locationbar/visit3.png")));
|
||||||
}
|
}
|
||||||
else if (count == 0) {
|
else if (count == 0) {
|
||||||
ui->historyLabel->setText(tr("You have <b>never</b> visited this site before."));
|
ui->historyLabel->setText(tr("You have <b>never</b> visited this site before."));
|
||||||
ui->historyIcon->setPixmap(QPixmap(":/icons/locationbar/visit1.png"));
|
ui->historyIcon->setPixmap(QPixmap(QSL(":/icons/locationbar/visit1.png")));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
ui->historyIcon->setPixmap(QPixmap(":/icons/locationbar/visit2.png"));
|
ui->historyIcon->setPixmap(QPixmap(QSL(":/icons/locationbar/visit2.png")));
|
||||||
QString text;
|
QString text;
|
||||||
if (count == 1) {
|
if (count == 1) {
|
||||||
text = tr("first");
|
text = tr("first");
|
||||||
|
@ -108,7 +108,7 @@ bool Updater::Version::operator <=(const Updater::Version &other) const
|
|||||||
|
|
||||||
QString Updater::Version::versionString() const
|
QString Updater::Version::versionString() const
|
||||||
{
|
{
|
||||||
return QString("%1.%2.%3").arg(majorVersion, minorVersion, revisionNumber);
|
return QSL("%1.%2.%3").arg(majorVersion, minorVersion, revisionNumber);
|
||||||
}
|
}
|
||||||
|
|
||||||
Updater::Updater(BrowserWindow* window, QObject* parent)
|
Updater::Updater(BrowserWindow* window, QObject* parent)
|
||||||
@ -120,8 +120,8 @@ Updater::Updater(BrowserWindow* window, QObject* parent)
|
|||||||
|
|
||||||
void Updater::start()
|
void Updater::start()
|
||||||
{
|
{
|
||||||
QUrl url = QUrl(QString("%1/update.php?v=%2&os=%3").arg(Qz::WWWADDRESS,
|
QUrl url = QUrl(QSL("%1/update.php?v=%2&os=%3").arg(QString::fromLatin1(Qz::WWWADDRESS),
|
||||||
Qz::VERSION,
|
QString::fromLatin1(Qz::VERSION),
|
||||||
QzTools::operatingSystem()));
|
QzTools::operatingSystem()));
|
||||||
|
|
||||||
startDownloadingUpdateInfo(url);
|
startDownloadingUpdateInfo(url);
|
||||||
@ -140,15 +140,15 @@ void Updater::downCompleted()
|
|||||||
if (!reply)
|
if (!reply)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
QString html = reply->readAll();
|
QString html = QString::fromUtf8(reply->readAll());
|
||||||
|
|
||||||
if (html.startsWith(QLatin1String("Version:"))) {
|
if (html.startsWith(QLatin1String("Version:"))) {
|
||||||
html.remove(QLatin1String("Version:"));
|
html.remove(QLatin1String("Version:"));
|
||||||
Version current(Qz::VERSION);
|
Version current(QString::fromLatin1(Qz::VERSION));
|
||||||
Version updated(html);
|
Version updated(html);
|
||||||
|
|
||||||
if (current.isValid && updated.isValid && current < updated) {
|
if (current.isValid && updated.isValid && current < updated) {
|
||||||
mApp->desktopNotifications()->showNotification(QIcon(":icons/falkon.svg").pixmap(48), tr("Update available"), tr("New version of Falkon is ready to download."));
|
mApp->desktopNotifications()->showNotification(QIcon(QSL(":icons/falkon.svg")).pixmap(48), tr("Update available"), tr("New version of Falkon is ready to download."));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -29,20 +29,20 @@ UserAgentManager::UserAgentManager(QObject* parent)
|
|||||||
, m_usePerDomainUserAgent(false)
|
, m_usePerDomainUserAgent(false)
|
||||||
{
|
{
|
||||||
m_defaultUserAgent = mApp->webProfile()->httpUserAgent();
|
m_defaultUserAgent = mApp->webProfile()->httpUserAgent();
|
||||||
m_defaultUserAgent.replace(QRegularExpression(QSL("(QtWebEngine/[^\\s]+)")), QSL("Falkon/%1 \\1").arg(Qz::VERSION));
|
m_defaultUserAgent.replace(QRegularExpression(QSL("(QtWebEngine/[^\\s]+)")), QSL("Falkon/%1 \\1").arg(QString::fromLatin1(Qz::VERSION)));
|
||||||
}
|
}
|
||||||
|
|
||||||
void UserAgentManager::loadSettings()
|
void UserAgentManager::loadSettings()
|
||||||
{
|
{
|
||||||
Settings settings;
|
Settings settings;
|
||||||
settings.beginGroup("Web-Browser-Settings");
|
settings.beginGroup(QSL("Web-Browser-Settings"));
|
||||||
m_globalUserAgent = settings.value("UserAgent", QString()).toString();
|
m_globalUserAgent = settings.value(QSL("UserAgent"), QString()).toString();
|
||||||
settings.endGroup();
|
settings.endGroup();
|
||||||
|
|
||||||
settings.beginGroup("User-Agent-Settings");
|
settings.beginGroup(QSL("User-Agent-Settings"));
|
||||||
m_usePerDomainUserAgent = settings.value("UsePerDomainUA", false).toBool();
|
m_usePerDomainUserAgent = settings.value(QSL("UsePerDomainUA"), false).toBool();
|
||||||
QStringList domainList = settings.value("DomainList", QStringList()).toStringList();
|
QStringList domainList = settings.value(QSL("DomainList"), QStringList()).toStringList();
|
||||||
QStringList userAgentsList = settings.value("UserAgentsList", QStringList()).toStringList();
|
QStringList userAgentsList = settings.value(QSL("UserAgentsList"), QStringList()).toStringList();
|
||||||
settings.endGroup();
|
settings.endGroup();
|
||||||
|
|
||||||
m_usePerDomainUserAgent = (m_usePerDomainUserAgent && domainList.count() == userAgentsList.count());
|
m_usePerDomainUserAgent = (m_usePerDomainUserAgent && domainList.count() == userAgentsList.count());
|
||||||
|
@ -157,8 +157,8 @@ void Plugins::loadSettings()
|
|||||||
}
|
}
|
||||||
|
|
||||||
Settings settings;
|
Settings settings;
|
||||||
settings.beginGroup("Plugin-Settings");
|
settings.beginGroup(QSL("Plugin-Settings"));
|
||||||
m_allowedPlugins = settings.value("AllowedPlugins", defaultAllowedPlugins).toStringList();
|
m_allowedPlugins = settings.value(QSL("AllowedPlugins"), defaultAllowedPlugins).toStringList();
|
||||||
settings.endGroup();
|
settings.endGroup();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -46,7 +46,7 @@ QString QmlCookie::name() const
|
|||||||
if (!m_cookie) {
|
if (!m_cookie) {
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
return QString(m_cookie->name());
|
return QString(QString::fromUtf8(m_cookie->name()));
|
||||||
}
|
}
|
||||||
|
|
||||||
QString QmlCookie::path() const
|
QString QmlCookie::path() const
|
||||||
@ -78,5 +78,5 @@ QString QmlCookie::value() const
|
|||||||
if (!m_cookie) {
|
if (!m_cookie) {
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
return QString(m_cookie->value());
|
return QString(QString::fromUtf8(m_cookie->value()));
|
||||||
}
|
}
|
||||||
|
@ -52,7 +52,7 @@ QNetworkCookie QmlCookies::getNetworkCookie(const QVariantMap &map)
|
|||||||
const QString url = map.value(QSL("url")).toString();
|
const QString url = map.value(QSL("url")).toString();
|
||||||
QVector<QNetworkCookie> cookies = mApp->cookieJar()->getAllCookies();
|
QVector<QNetworkCookie> cookies = mApp->cookieJar()->getAllCookies();
|
||||||
for (const QNetworkCookie &cookie : qAsConst(cookies)) {
|
for (const QNetworkCookie &cookie : qAsConst(cookies)) {
|
||||||
if (cookie.name() == name && cookie.domain() == url) {
|
if (QString::fromUtf8(cookie.name()) == name && cookie.domain() == url) {
|
||||||
return cookie;
|
return cookie;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -75,7 +75,7 @@ QList<QObject*> QmlCookies::getAll(const QVariantMap &map)
|
|||||||
const bool session = map.value(QSL("session")).toBool();
|
const bool session = map.value(QSL("session")).toBool();
|
||||||
QVector<QNetworkCookie> cookies = mApp->cookieJar()->getAllCookies();
|
QVector<QNetworkCookie> cookies = mApp->cookieJar()->getAllCookies();
|
||||||
for (QNetworkCookie cookie : qAsConst(cookies)) {
|
for (QNetworkCookie cookie : qAsConst(cookies)) {
|
||||||
if ((!map.contains(QSL("name")) || cookie.name() == name)
|
if ((!map.contains(QSL("name")) || QString::fromUtf8(cookie.name()) == name)
|
||||||
&& (!map.contains(QSL("url")) || cookie.domain() == url)
|
&& (!map.contains(QSL("url")) || cookie.domain() == url)
|
||||||
&& (!map.contains(QSL("path")) || cookie.path() == path)
|
&& (!map.contains(QSL("path")) || cookie.path() == path)
|
||||||
&& (!map.contains(QSL("secure")) || cookie.isSecure() == secure)
|
&& (!map.contains(QSL("secure")) || cookie.isSecure() == secure)
|
||||||
|
@ -33,7 +33,7 @@ void QmlI18n::initTranslations()
|
|||||||
const bool isLanguageSet = qEnvironmentVariableIsSet("LANGUAGE");
|
const bool isLanguageSet = qEnvironmentVariableIsSet("LANGUAGE");
|
||||||
const QByteArray language = qgetenv("LANGUAGE");
|
const QByteArray language = qgetenv("LANGUAGE");
|
||||||
qputenv("LANGUAGE", QLocale::system().name().toUtf8());
|
qputenv("LANGUAGE", QLocale::system().name().toUtf8());
|
||||||
bindtextdomain(m_domain.toUtf8(), localeDir.toUtf8());
|
bindtextdomain(m_domain.toUtf8().constData(), localeDir.toUtf8().constData());
|
||||||
if (!isLanguageSet) {
|
if (!isLanguageSet) {
|
||||||
qunsetenv("LANGUAGE");
|
qunsetenv("LANGUAGE");
|
||||||
} else {
|
} else {
|
||||||
@ -43,10 +43,10 @@ void QmlI18n::initTranslations()
|
|||||||
|
|
||||||
QString QmlI18n::i18n(const QString &string)
|
QString QmlI18n::i18n(const QString &string)
|
||||||
{
|
{
|
||||||
return QString::fromUtf8(dgettext(m_domain.toUtf8(), string.toUtf8()));
|
return QString::fromUtf8(dgettext(m_domain.toUtf8().constData(), string.toUtf8().constData()));
|
||||||
}
|
}
|
||||||
|
|
||||||
QString QmlI18n::i18np(const QString &string1, const QString &string2, int count)
|
QString QmlI18n::i18np(const QString &string1, const QString &string2, int count)
|
||||||
{
|
{
|
||||||
return QString::fromUtf8(dngettext(m_domain.toUtf8(), string1.toUtf8(), string2.toUtf8(), count));
|
return QString::fromUtf8(dngettext(m_domain.toUtf8().constData(), string1.toUtf8().constData(), string2.toUtf8().constData(), count));
|
||||||
}
|
}
|
||||||
|
@ -46,7 +46,7 @@ void QmlAction::setProperties(const QVariantMap &map)
|
|||||||
} else if (key == QSL("shortcut")) {
|
} else if (key == QSL("shortcut")) {
|
||||||
m_action->setShortcut(QKeySequence(map.value(key).toString()));
|
m_action->setShortcut(QKeySequence(map.value(key).toString()));
|
||||||
} else {
|
} else {
|
||||||
m_action->setProperty(key.toUtf8(), map.value(key));
|
m_action->setProperty(key.toUtf8().constData(), map.value(key));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -61,7 +61,7 @@ QmlMenu *QmlMenu::addMenu(const QVariantMap &map)
|
|||||||
newMenu->setIcon(icon);
|
newMenu->setIcon(icon);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
newMenu->setProperty(key.toUtf8(), map.value(key));
|
newMenu->setProperty(key.toUtf8().constData(), map.value(key));
|
||||||
}
|
}
|
||||||
m_menu->addMenu(newMenu);
|
m_menu->addMenu(newMenu);
|
||||||
auto *newQmlMenu = new QmlMenu(newMenu, m_engine, this);
|
auto *newQmlMenu = new QmlMenu(newMenu, m_engine, this);
|
||||||
|
@ -93,7 +93,7 @@ void QmlPlugins::registerQmlTypes()
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Cookies
|
// Cookies
|
||||||
qmlRegisterUncreatableType<QmlCookie>(url, majorVersion, minorVersion, "Cookie", "Unable to register type: Cookie");
|
qmlRegisterUncreatableType<QmlCookie>(url, majorVersion, minorVersion, "Cookie", QSL("Unable to register type: Cookie"));
|
||||||
|
|
||||||
qmlRegisterSingletonType<QmlCookies>(url, majorVersion, minorVersion, "Cookies", [](QQmlEngine *engine, QJSEngine *scriptEngine) -> QObject * {
|
qmlRegisterSingletonType<QmlCookies>(url, majorVersion, minorVersion, "Cookies", [](QQmlEngine *engine, QJSEngine *scriptEngine) -> QObject * {
|
||||||
Q_UNUSED(engine)
|
Q_UNUSED(engine)
|
||||||
|
@ -53,28 +53,28 @@ void SpeedDial::loadSettings()
|
|||||||
m_loaded = true;
|
m_loaded = true;
|
||||||
|
|
||||||
Settings settings;
|
Settings settings;
|
||||||
settings.beginGroup("SpeedDial");
|
settings.beginGroup(QSL("SpeedDial"));
|
||||||
QString allPages = settings.value("pages", QString()).toString();
|
QString allPages = settings.value(QSL("pages"), QString()).toString();
|
||||||
setBackgroundImage(settings.value("background", QString()).toString());
|
setBackgroundImage(settings.value(QSL("background"), QString()).toString());
|
||||||
m_backgroundImageSize = settings.value("backsize", "auto").toString();
|
m_backgroundImageSize = settings.value(QSL("backsize"), QSL("auto")).toString();
|
||||||
m_maxPagesInRow = settings.value("pagesrow", 4).toInt();
|
m_maxPagesInRow = settings.value(QSL("pagesrow"), 4).toInt();
|
||||||
m_sizeOfSpeedDials = settings.value("sdsize", 231).toInt();
|
m_sizeOfSpeedDials = settings.value(QSL("sdsize"), 231).toInt();
|
||||||
m_sdcentered = settings.value("sdcenter", false).toBool();
|
m_sdcentered = settings.value(QSL("sdcenter"), false).toBool();
|
||||||
settings.endGroup();
|
settings.endGroup();
|
||||||
|
|
||||||
if (allPages.isEmpty()) {
|
if (allPages.isEmpty()) {
|
||||||
allPages = "url:\"https://www.falkon.org\"|title:\"Falkon\";"
|
allPages = QL1S("url:\"https://www.falkon.org\"|title:\"Falkon\";"
|
||||||
"url:\"https://store.falkon.org\"|title:\"Falkon Store\";"
|
"url:\"https://store.falkon.org\"|title:\"Falkon Store\";"
|
||||||
"url:\"https://www.kde.org\"|title:\"KDE Planet\";"
|
"url:\"https://www.kde.org\"|title:\"KDE Planet\";"
|
||||||
"url:\"https://planet.kde.org\"|title:\"KDE Community\";";
|
"url:\"https://planet.kde.org\"|title:\"KDE Community\";");
|
||||||
}
|
}
|
||||||
changed(allPages);
|
changed(allPages);
|
||||||
|
|
||||||
m_thumbnailsDir = DataPaths::currentProfilePath() + "/thumbnails/";
|
m_thumbnailsDir = DataPaths::currentProfilePath() + QSL("/thumbnails/");
|
||||||
|
|
||||||
// If needed, create thumbnails directory
|
// If needed, create thumbnails directory
|
||||||
if (!QDir(m_thumbnailsDir).exists()) {
|
if (!QDir(m_thumbnailsDir).exists()) {
|
||||||
QDir(DataPaths::currentProfilePath()).mkdir("thumbnails");
|
QDir(DataPaths::currentProfilePath()).mkdir(QSL("thumbnails"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -83,13 +83,13 @@ void SpeedDial::saveSettings()
|
|||||||
ENSURE_LOADED;
|
ENSURE_LOADED;
|
||||||
|
|
||||||
Settings settings;
|
Settings settings;
|
||||||
settings.beginGroup("SpeedDial");
|
settings.beginGroup(QSL("SpeedDial"));
|
||||||
settings.setValue("pages", generateAllPages());
|
settings.setValue(QSL("pages"), generateAllPages());
|
||||||
settings.setValue("background", m_backgroundImageUrl);
|
settings.setValue(QSL("background"), m_backgroundImageUrl);
|
||||||
settings.setValue("backsize", m_backgroundImageSize);
|
settings.setValue(QSL("backsize"), m_backgroundImageSize);
|
||||||
settings.setValue("pagesrow", m_maxPagesInRow);
|
settings.setValue(QSL("pagesrow"), m_maxPagesInRow);
|
||||||
settings.setValue("sdsize", m_sizeOfSpeedDials);
|
settings.setValue(QSL("sdsize"), m_sizeOfSpeedDials);
|
||||||
settings.setValue("sdcenter", m_sdcentered);
|
settings.setValue(QSL("sdcenter"), m_sdcentered);
|
||||||
settings.endGroup();
|
settings.endGroup();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -208,10 +208,10 @@ QString SpeedDial::initialScript()
|
|||||||
QVariantList pages;
|
QVariantList pages;
|
||||||
|
|
||||||
for (const Page &page : qAsConst(m_pages)) {
|
for (const Page &page : qAsConst(m_pages)) {
|
||||||
QString imgSource = m_thumbnailsDir + QCryptographicHash::hash(page.url.toUtf8(), QCryptographicHash::Md4).toHex() + ".png";
|
QString imgSource = m_thumbnailsDir + QString::fromLatin1(QCryptographicHash::hash(page.url.toUtf8(), QCryptographicHash::Md4).toHex()) + QSL(".png");
|
||||||
|
|
||||||
if (!QFile(imgSource).exists()) {
|
if (!QFile(imgSource).exists()) {
|
||||||
imgSource = "qrc:html/loading.gif";
|
imgSource = QSL("qrc:html/loading.gif");
|
||||||
|
|
||||||
if (!page.isValid()) {
|
if (!page.isValid()) {
|
||||||
imgSource.clear();
|
imgSource.clear();
|
||||||
@ -228,7 +228,7 @@ QString SpeedDial::initialScript()
|
|||||||
pages.append(map);
|
pages.append(map);
|
||||||
}
|
}
|
||||||
|
|
||||||
m_initialScript = QJsonDocument::fromVariant(pages).toJson(QJsonDocument::Compact);
|
m_initialScript = QString::fromUtf8(QJsonDocument::fromVariant(pages).toJson(QJsonDocument::Compact));
|
||||||
return m_initialScript;
|
return m_initialScript;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -273,7 +273,7 @@ void SpeedDial::loadThumbnail(const QString &url, bool loadTitle)
|
|||||||
|
|
||||||
void SpeedDial::removeImageForUrl(const QString &url)
|
void SpeedDial::removeImageForUrl(const QString &url)
|
||||||
{
|
{
|
||||||
QString fileName = m_thumbnailsDir + QCryptographicHash::hash(url.toUtf8(), QCryptographicHash::Md4).toHex() + ".png";
|
QString fileName = m_thumbnailsDir + QString::fromLatin1(QCryptographicHash::hash(url.toUtf8(), QCryptographicHash::Md4).toHex()) + QSL(".png");
|
||||||
|
|
||||||
if (QFile(fileName).exists()) {
|
if (QFile(fileName).exists()) {
|
||||||
QFile(fileName).remove();
|
QFile(fileName).remove();
|
||||||
@ -282,13 +282,13 @@ void SpeedDial::removeImageForUrl(const QString &url)
|
|||||||
|
|
||||||
QStringList SpeedDial::getOpenFileName()
|
QStringList SpeedDial::getOpenFileName()
|
||||||
{
|
{
|
||||||
const QString fileTypes = QString("%3(*.png *.jpg *.jpeg *.bmp *.gif *.svg *.tiff)").arg(tr("Image files"));
|
const QString fileTypes = QSL("%3(*.png *.jpg *.jpeg *.bmp *.gif *.svg *.tiff)").arg(tr("Image files"));
|
||||||
const QString image = QzTools::getOpenFileName("SpeedDial-GetOpenFileName", 0, tr("Click to select image..."), QDir::homePath(), fileTypes);
|
const QString image = QzTools::getOpenFileName(QSL("SpeedDial-GetOpenFileName"), 0, tr("Click to select image..."), QDir::homePath(), fileTypes);
|
||||||
|
|
||||||
if (image.isEmpty())
|
if (image.isEmpty())
|
||||||
return {};
|
return {};
|
||||||
|
|
||||||
return {QzTools::pixmapToDataUrl(QPixmap(image)).toString(), QUrl::fromLocalFile(image).toEncoded()};
|
return {QzTools::pixmapToDataUrl(QPixmap(image)).toString(), QString::fromUtf8(QUrl::fromLocalFile(image).toEncoded())};
|
||||||
}
|
}
|
||||||
|
|
||||||
QString SpeedDial::urlFromUserInput(const QString &url)
|
QString SpeedDial::urlFromUserInput(const QString &url)
|
||||||
@ -334,10 +334,10 @@ void SpeedDial::thumbnailCreated(const QPixmap &pixmap)
|
|||||||
bool loadTitle = thumbnailer->loadTitle();
|
bool loadTitle = thumbnailer->loadTitle();
|
||||||
QString title = thumbnailer->title();
|
QString title = thumbnailer->title();
|
||||||
QString url = thumbnailer->url().toString();
|
QString url = thumbnailer->url().toString();
|
||||||
QString fileName = m_thumbnailsDir + QCryptographicHash::hash(url.toUtf8(), QCryptographicHash::Md4).toHex() + ".png";
|
QString fileName = m_thumbnailsDir + QString::fromLatin1(QCryptographicHash::hash(url.toUtf8(), QCryptographicHash::Md4).toHex()) + QSL(".png");
|
||||||
|
|
||||||
if (pixmap.isNull()) {
|
if (pixmap.isNull()) {
|
||||||
fileName = ":/html/broken-page.svg";
|
fileName = QSL(":/html/broken-page.svg");
|
||||||
title = tr("Unable to load");
|
title = tr("Unable to load");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -375,7 +375,7 @@ QString SpeedDial::generateAllPages()
|
|||||||
QString allPages;
|
QString allPages;
|
||||||
|
|
||||||
for (const Page &page : qAsConst(m_pages)) {
|
for (const Page &page : qAsConst(m_pages)) {
|
||||||
const QString string = QString(R"(url:"%1"|title:"%2";)").arg(page.url, page.title);
|
const QString string = QSL(R"(url:"%1"|title:"%2";)").arg(page.url, page.title);
|
||||||
allPages.append(string);
|
allPages.append(string);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -81,10 +81,10 @@ PopupWindow::PopupWindow(PopupWebView* view)
|
|||||||
m_menuBar = new QMenuBar(this);
|
m_menuBar = new QMenuBar(this);
|
||||||
|
|
||||||
auto* menuFile = new QMenu(tr("File"));
|
auto* menuFile = new QMenu(tr("File"));
|
||||||
menuFile->addAction(QIcon::fromTheme("mail-message-new"), tr("Send Link..."), m_view, &WebView::sendPageByMail);
|
menuFile->addAction(QIcon::fromTheme(QSL("mail-message-new")), tr("Send Link..."), m_view, &WebView::sendPageByMail);
|
||||||
menuFile->addAction(QIcon::fromTheme("document-print"), tr("&Print..."), m_view, &WebView::printPage)->setShortcut(QKeySequence("Ctrl+P"));
|
menuFile->addAction(QIcon::fromTheme(QSL("document-print")), tr("&Print..."), m_view, &WebView::printPage)->setShortcut(QKeySequence(QSL("Ctrl+P")));
|
||||||
menuFile->addSeparator();
|
menuFile->addSeparator();
|
||||||
menuFile->addAction(QIcon::fromTheme("window-close"), tr("Close"), this, &QWidget::close)->setShortcut(QKeySequence("Ctrl+W"));
|
menuFile->addAction(QIcon::fromTheme(QSL("window-close")), tr("Close"), this, &QWidget::close)->setShortcut(QKeySequence(QSL("Ctrl+W")));
|
||||||
m_menuBar->addMenu(menuFile);
|
m_menuBar->addMenu(menuFile);
|
||||||
|
|
||||||
m_menuEdit = new QMenu(tr("Edit"));
|
m_menuEdit = new QMenu(tr("Edit"));
|
||||||
@ -96,25 +96,25 @@ PopupWindow::PopupWindow(PopupWebView* view)
|
|||||||
m_menuEdit->addAction(m_view->pageAction(QWebEnginePage::Paste));
|
m_menuEdit->addAction(m_view->pageAction(QWebEnginePage::Paste));
|
||||||
m_menuEdit->addSeparator();
|
m_menuEdit->addSeparator();
|
||||||
m_menuEdit->addAction(m_view->pageAction(QWebEnginePage::SelectAll));
|
m_menuEdit->addAction(m_view->pageAction(QWebEnginePage::SelectAll));
|
||||||
m_menuEdit->addAction(QIcon::fromTheme("edit-find"), tr("Find"), this, &PopupWindow::searchOnPage)->setShortcut(QKeySequence("Ctrl+F"));
|
m_menuEdit->addAction(QIcon::fromTheme(QSL("edit-find")), tr("Find"), this, &PopupWindow::searchOnPage)->setShortcut(QKeySequence(QSL("Ctrl+F")));
|
||||||
m_menuBar->addMenu(m_menuEdit);
|
m_menuBar->addMenu(m_menuEdit);
|
||||||
|
|
||||||
m_menuView = new QMenu(tr("View"));
|
m_menuView = new QMenu(tr("View"));
|
||||||
m_actionStop = m_menuView->addAction(QIcon::fromTheme(QSL("process-stop")), tr("&Stop"), m_view, &QWebEngineView::stop);
|
m_actionStop = m_menuView->addAction(QIcon::fromTheme(QSL("process-stop")), tr("&Stop"), m_view, &QWebEngineView::stop);
|
||||||
m_actionStop->setShortcut(QKeySequence("Esc"));
|
m_actionStop->setShortcut(QKeySequence(QSL("Esc")));
|
||||||
m_actionReload = m_menuView->addAction(QIcon::fromTheme(QSL("view-refresh")), tr("&Reload"), m_view, &QWebEngineView::reload);
|
m_actionReload = m_menuView->addAction(QIcon::fromTheme(QSL("view-refresh")), tr("&Reload"), m_view, &QWebEngineView::reload);
|
||||||
m_actionReload->setShortcut(QKeySequence("F5"));
|
m_actionReload->setShortcut(QKeySequence(QSL("F5")));
|
||||||
m_menuView->addSeparator();
|
m_menuView->addSeparator();
|
||||||
m_menuView->addAction(QIcon::fromTheme("zoom-in"), tr("Zoom &In"), m_view, &WebView::zoomIn)->setShortcut(QKeySequence("Ctrl++"));
|
m_menuView->addAction(QIcon::fromTheme(QSL("zoom-in")), tr("Zoom &In"), m_view, &WebView::zoomIn)->setShortcut(QKeySequence(QSL("Ctrl++")));
|
||||||
m_menuView->addAction(QIcon::fromTheme("zoom-out"), tr("Zoom &Out"), m_view, &WebView::zoomOut)->setShortcut(QKeySequence("Ctrl+-"));
|
m_menuView->addAction(QIcon::fromTheme(QSL("zoom-out")), tr("Zoom &Out"), m_view, &WebView::zoomOut)->setShortcut(QKeySequence(QSL("Ctrl+-")));
|
||||||
m_menuView->addAction(QIcon::fromTheme("zoom-original"), tr("Reset"), m_view, &WebView::zoomReset)->setShortcut(QKeySequence("Ctrl+0"));
|
m_menuView->addAction(QIcon::fromTheme(QSL("zoom-original")), tr("Reset"), m_view, &WebView::zoomReset)->setShortcut(QKeySequence(QSL("Ctrl+0")));
|
||||||
m_menuView->addSeparator();
|
m_menuView->addSeparator();
|
||||||
m_menuView->addAction(QIcon::fromTheme("text-html"), tr("&Page Source"), m_view, &WebView::showSource)->setShortcut(QKeySequence("Ctrl+U"));
|
m_menuView->addAction(QIcon::fromTheme(QSL("text-html")), tr("&Page Source"), m_view, &WebView::showSource)->setShortcut(QKeySequence(QSL("Ctrl+U")));
|
||||||
m_menuBar->addMenu(m_menuView);
|
m_menuBar->addMenu(m_menuView);
|
||||||
|
|
||||||
// Make shortcuts available even with hidden menubar
|
// Make shortcuts available even with hidden menubar
|
||||||
QList<QAction*> actions = m_menuBar->actions();
|
QList<QAction*> actions = m_menuBar->actions();
|
||||||
foreach (QAction* action, actions) {
|
for (QAction* action : std::as_const(actions)) {
|
||||||
if (action->menu()) {
|
if (action->menu()) {
|
||||||
actions += action->menu()->actions();
|
actions += action->menu()->actions();
|
||||||
}
|
}
|
||||||
@ -273,7 +273,7 @@ void PopupWindow::titleChanged()
|
|||||||
|
|
||||||
void PopupWindow::setWindowGeometry(QRect newRect)
|
void PopupWindow::setWindowGeometry(QRect newRect)
|
||||||
{
|
{
|
||||||
if (!Settings().value("allowJavaScriptGeometryChange", true).toBool())
|
if (!Settings().value(QSL("allowJavaScriptGeometryChange"), true).toBool())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// left/top was set while width/height not
|
// left/top was set while width/height not
|
||||||
|
@ -64,7 +64,7 @@ QByteArray AcceptLanguage::generateHeader(const QStringList &langs)
|
|||||||
|
|
||||||
int counter = 8;
|
int counter = 8;
|
||||||
for (int i = 1; i < langs.count(); i++) {
|
for (int i = 1; i < langs.count(); i++) {
|
||||||
QString s = "," + langs.at(i) + ";q=0.";
|
QString s = QSL(",") + langs.at(i) + QSL(";q=0.");
|
||||||
s.append(QString::number(counter));
|
s.append(QString::number(counter));
|
||||||
if (counter != 2) {
|
if (counter != 2) {
|
||||||
counter -= 2;
|
counter -= 2;
|
||||||
@ -86,8 +86,8 @@ AcceptLanguage::AcceptLanguage(QWidget* parent)
|
|||||||
ui->listWidget->setLayoutDirection(Qt::LeftToRight);
|
ui->listWidget->setLayoutDirection(Qt::LeftToRight);
|
||||||
|
|
||||||
Settings settings;
|
Settings settings;
|
||||||
settings.beginGroup("Language");
|
settings.beginGroup(QSL("Language"));
|
||||||
const QStringList langs = settings.value("acceptLanguage", defaultLanguage()).toStringList();
|
const QStringList langs = settings.value(QSL("acceptLanguage"), defaultLanguage()).toStringList();
|
||||||
settings.endGroup();
|
settings.endGroup();
|
||||||
|
|
||||||
for (const QString &code : langs) {
|
for (const QString &code : langs) {
|
||||||
@ -99,7 +99,7 @@ AcceptLanguage::AcceptLanguage(QWidget* parent)
|
|||||||
label = tr("Personal [%1]").arg(code);
|
label = tr("Personal [%1]").arg(code);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
label = QString("%1/%2 [%3]").arg(loc.languageToString(loc.language()), loc.countryToString(loc.country()), code);
|
label = QSL("%1/%2 [%3]").arg(loc.languageToString(loc.language()), loc.countryToString(loc.country()), code);
|
||||||
}
|
}
|
||||||
|
|
||||||
ui->listWidget->addItem(label);
|
ui->listWidget->addItem(label);
|
||||||
@ -216,8 +216,8 @@ void AcceptLanguage::accept()
|
|||||||
}
|
}
|
||||||
|
|
||||||
Settings settings;
|
Settings settings;
|
||||||
settings.beginGroup("Language");
|
settings.beginGroup(QSL("Language"));
|
||||||
settings.setValue("acceptLanguage", langs);
|
settings.setValue(QSL("acceptLanguage"), langs);
|
||||||
|
|
||||||
mApp->networkManager()->loadSettings();
|
mApp->networkManager()->loadSettings();
|
||||||
|
|
||||||
|
@ -70,7 +70,7 @@ AutoFillManager::AutoFillManager(QWidget* parent)
|
|||||||
ui->search->setPlaceholderText(tr("Search"));
|
ui->search->setPlaceholderText(tr("Search"));
|
||||||
|
|
||||||
// Password backends
|
// Password backends
|
||||||
ui->currentBackend->setText(QString("<b>%1</b>").arg(m_passwordManager->activeBackend()->name()));
|
ui->currentBackend->setText(QSL("<b>%1</b>").arg(m_passwordManager->activeBackend()->name()));
|
||||||
ui->backendOptions->setVisible(m_passwordManager->activeBackend()->hasSettings());
|
ui->backendOptions->setVisible(m_passwordManager->activeBackend()->hasSettings());
|
||||||
|
|
||||||
// Load passwords
|
// Load passwords
|
||||||
@ -89,7 +89,7 @@ void AutoFillManager::loadPasswords()
|
|||||||
auto* item = new QTreeWidgetItem(ui->treePass);
|
auto* item = new QTreeWidgetItem(ui->treePass);
|
||||||
item->setText(0, entry.host);
|
item->setText(0, entry.host);
|
||||||
item->setText(1, entry.username);
|
item->setText(1, entry.username);
|
||||||
item->setText(2, "*****");
|
item->setText(2, QSL("*****"));
|
||||||
|
|
||||||
QVariant v;
|
QVariant v;
|
||||||
v.setValue(entry);
|
v.setValue(entry);
|
||||||
@ -98,7 +98,7 @@ void AutoFillManager::loadPasswords()
|
|||||||
}
|
}
|
||||||
|
|
||||||
QSqlQuery query(SqlDatabase::instance()->database());
|
QSqlQuery query(SqlDatabase::instance()->database());
|
||||||
query.exec("SELECT server, id FROM autofill_exceptions");
|
query.exec(QSL("SELECT server, id FROM autofill_exceptions"));
|
||||||
ui->treeExcept->clear();
|
ui->treeExcept->clear();
|
||||||
while (query.next()) {
|
while (query.next()) {
|
||||||
auto* item = new QTreeWidgetItem(ui->treeExcept);
|
auto* item = new QTreeWidgetItem(ui->treeExcept);
|
||||||
@ -165,7 +165,7 @@ void AutoFillManager::showPasswords()
|
|||||||
if (!item) {
|
if (!item) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
item->setText(2, "*****");
|
item->setText(2, QSL("*****"));
|
||||||
}
|
}
|
||||||
|
|
||||||
ui->showPasswords->setText(tr("Show Passwords"));
|
ui->showPasswords->setText(tr("Show Passwords"));
|
||||||
@ -277,7 +277,7 @@ void AutoFillManager::removeExcept()
|
|||||||
}
|
}
|
||||||
QString id = curItem->data(0, Qt::UserRole + 10).toString();
|
QString id = curItem->data(0, Qt::UserRole + 10).toString();
|
||||||
QSqlQuery query(SqlDatabase::instance()->database());
|
QSqlQuery query(SqlDatabase::instance()->database());
|
||||||
query.prepare("DELETE FROM autofill_exceptions WHERE id=?");
|
query.prepare(QSL("DELETE FROM autofill_exceptions WHERE id=?"));
|
||||||
query.addBindValue(id);
|
query.addBindValue(id);
|
||||||
query.exec();
|
query.exec();
|
||||||
|
|
||||||
@ -287,7 +287,7 @@ void AutoFillManager::removeExcept()
|
|||||||
void AutoFillManager::removeAllExcept()
|
void AutoFillManager::removeAllExcept()
|
||||||
{
|
{
|
||||||
QSqlQuery query(SqlDatabase::instance()->database());
|
QSqlQuery query(SqlDatabase::instance()->database());
|
||||||
query.exec("DELETE FROM autofill_exceptions");
|
query.exec(QSL("DELETE FROM autofill_exceptions"));
|
||||||
|
|
||||||
ui->treeExcept->clear();
|
ui->treeExcept->clear();
|
||||||
}
|
}
|
||||||
@ -299,7 +299,7 @@ void AutoFillManager::showExceptions()
|
|||||||
|
|
||||||
void AutoFillManager::importPasswords()
|
void AutoFillManager::importPasswords()
|
||||||
{
|
{
|
||||||
m_fileName = QzTools::getOpenFileName("AutoFill-ImportPasswords", this, tr("Choose file..."), QDir::homePath() + "/passwords.xml", "*.xml");
|
m_fileName = QzTools::getOpenFileName(QSL("AutoFill-ImportPasswords"), this, tr("Choose file..."), QDir::homePath() + QSL("/passwords.xml"), QSL("*.xml"));
|
||||||
|
|
||||||
if (m_fileName.isEmpty()) {
|
if (m_fileName.isEmpty()) {
|
||||||
return;
|
return;
|
||||||
@ -310,7 +310,7 @@ void AutoFillManager::importPasswords()
|
|||||||
|
|
||||||
void AutoFillManager::exportPasswords()
|
void AutoFillManager::exportPasswords()
|
||||||
{
|
{
|
||||||
m_fileName = QzTools::getSaveFileName("AutoFill-ExportPasswords", this, tr("Choose file..."), QDir::homePath() + "/passwords.xml", "*.xml");
|
m_fileName = QzTools::getSaveFileName(QSL("AutoFill-ExportPasswords"), this, tr("Choose file..."), QDir::homePath() + QSL("/passwords.xml"), QSL("*.xml"));
|
||||||
|
|
||||||
if (m_fileName.isEmpty()) {
|
if (m_fileName.isEmpty()) {
|
||||||
return;
|
return;
|
||||||
@ -360,7 +360,7 @@ void AutoFillManager::slotExportPasswords()
|
|||||||
|
|
||||||
void AutoFillManager::currentPasswordBackendChanged()
|
void AutoFillManager::currentPasswordBackendChanged()
|
||||||
{
|
{
|
||||||
ui->currentBackend->setText(QString("<b>%1</b>").arg(m_passwordManager->activeBackend()->name()));
|
ui->currentBackend->setText(QSL("<b>%1</b>").arg(m_passwordManager->activeBackend()->name()));
|
||||||
ui->backendOptions->setVisible(m_passwordManager->activeBackend()->hasSettings());
|
ui->backendOptions->setVisible(m_passwordManager->activeBackend()->hasSettings());
|
||||||
|
|
||||||
QTimer::singleShot(0, this, &AutoFillManager::loadPasswords);
|
QTimer::singleShot(0, this, &AutoFillManager::loadPasswords);
|
||||||
|
@ -36,8 +36,8 @@ CertificateManager::CertificateManager(QWidget* parent)
|
|||||||
ui->listWidget->setLayoutDirection(Qt::LeftToRight);
|
ui->listWidget->setLayoutDirection(Qt::LeftToRight);
|
||||||
|
|
||||||
Settings settings;
|
Settings settings;
|
||||||
settings.beginGroup("Web-Browser-Settings");
|
settings.beginGroup(QSL("Web-Browser-Settings"));
|
||||||
m_ignoredSslHosts = settings.value("IgnoredSslHosts", QStringList()).toStringList();
|
m_ignoredSslHosts = settings.value(QSL("IgnoredSslHosts"), QStringList()).toStringList();
|
||||||
settings.endGroup();
|
settings.endGroup();
|
||||||
ui->listWidget->addItems(m_ignoredSslHosts);
|
ui->listWidget->addItems(m_ignoredSslHosts);
|
||||||
|
|
||||||
@ -101,8 +101,8 @@ void CertificateManager::removeException()
|
|||||||
void CertificateManager::accept()
|
void CertificateManager::accept()
|
||||||
{
|
{
|
||||||
Settings settings;
|
Settings settings;
|
||||||
settings.beginGroup("Web-Browser-Settings");
|
settings.beginGroup(QSL("Web-Browser-Settings"));
|
||||||
settings.setValue("IgnoredSslHosts", m_ignoredSslHosts);
|
settings.setValue(QSL("IgnoredSslHosts"), m_ignoredSslHosts);
|
||||||
settings.endGroup();
|
settings.endGroup();
|
||||||
|
|
||||||
mApp->networkManager()->loadSettings();
|
mApp->networkManager()->loadSettings();
|
||||||
|
@ -31,22 +31,22 @@ JsOptions::JsOptions(QWidget* parent)
|
|||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
|
||||||
Settings settings;
|
Settings settings;
|
||||||
settings.beginGroup("Web-Browser-Settings");
|
settings.beginGroup(QSL("Web-Browser-Settings"));
|
||||||
ui->jscanOpenWindow->setChecked(settings.value("allowJavaScriptOpenWindow", false).toBool());
|
ui->jscanOpenWindow->setChecked(settings.value(QSL("allowJavaScriptOpenWindow"), false).toBool());
|
||||||
ui->jscanActivateWindow->setChecked(settings.value("allowJavaScriptActivateWindow", false).toBool());
|
ui->jscanActivateWindow->setChecked(settings.value(QSL("allowJavaScriptActivateWindow"), false).toBool());
|
||||||
ui->jscanAccessClipboard->setChecked(settings.value("allowJavaScriptAccessClipboard", true).toBool());
|
ui->jscanAccessClipboard->setChecked(settings.value(QSL("allowJavaScriptAccessClipboard"), true).toBool());
|
||||||
ui->jscanPaste->setChecked(settings.value("allowJavaScriptPaste", true).toBool());
|
ui->jscanPaste->setChecked(settings.value(QSL("allowJavaScriptPaste"), true).toBool());
|
||||||
settings.endGroup();
|
settings.endGroup();
|
||||||
}
|
}
|
||||||
|
|
||||||
void JsOptions::accept()
|
void JsOptions::accept()
|
||||||
{
|
{
|
||||||
Settings settings;
|
Settings settings;
|
||||||
settings.beginGroup("Web-Browser-Settings");
|
settings.beginGroup(QSL("Web-Browser-Settings"));
|
||||||
settings.setValue("allowJavaScriptOpenWindow", ui->jscanOpenWindow->isChecked());
|
settings.setValue(QSL("allowJavaScriptOpenWindow"), ui->jscanOpenWindow->isChecked());
|
||||||
settings.setValue("allowJavaScriptActivateWindow", ui->jscanActivateWindow->isChecked());
|
settings.setValue(QSL("allowJavaScriptActivateWindow"), ui->jscanActivateWindow->isChecked());
|
||||||
settings.setValue("allowJavaScriptAccessClipboard", ui->jscanAccessClipboard->isChecked());
|
settings.setValue(QSL("allowJavaScriptAccessClipboard"), ui->jscanAccessClipboard->isChecked());
|
||||||
settings.setValue("allowJavaScriptPaste", ui->jscanPaste->isChecked());
|
settings.setValue(QSL("allowJavaScriptPaste"), ui->jscanPaste->isChecked());
|
||||||
settings.endGroup();
|
settings.endGroup();
|
||||||
|
|
||||||
QDialog::close();
|
QDialog::close();
|
||||||
|
@ -42,8 +42,8 @@ PluginsManager::PluginsManager(QWidget* parent)
|
|||||||
|
|
||||||
//Application Extensions
|
//Application Extensions
|
||||||
Settings settings;
|
Settings settings;
|
||||||
settings.beginGroup("Plugin-Settings");
|
settings.beginGroup(QSL("Plugin-Settings"));
|
||||||
bool appPluginsEnabled = settings.value("EnablePlugins", true).toBool();
|
bool appPluginsEnabled = settings.value(QSL("EnablePlugins"), true).toBool();
|
||||||
settings.endGroup();
|
settings.endGroup();
|
||||||
|
|
||||||
ui->list->setEnabled(appPluginsEnabled);
|
ui->list->setEnabled(appPluginsEnabled);
|
||||||
@ -83,8 +83,8 @@ void PluginsManager::save()
|
|||||||
}
|
}
|
||||||
|
|
||||||
Settings settings;
|
Settings settings;
|
||||||
settings.beginGroup("Plugin-Settings");
|
settings.beginGroup(QSL("Plugin-Settings"));
|
||||||
settings.setValue("AllowedPlugins", allowedPlugins);
|
settings.setValue(QSL("AllowedPlugins"), allowedPlugins);
|
||||||
settings.endGroup();
|
settings.endGroup();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -77,7 +77,7 @@ static QString createLanguageItem(const QString &lang)
|
|||||||
return QString::fromUtf8("Castellano");
|
return QString::fromUtf8("Castellano");
|
||||||
}
|
}
|
||||||
if (lang == QLatin1String("nqo")) {
|
if (lang == QLatin1String("nqo")) {
|
||||||
return {"N'ko (nqo)"};
|
return QSL("N'ko (nqo)");
|
||||||
}
|
}
|
||||||
if (lang == QLatin1String("sr")) {
|
if (lang == QLatin1String("sr")) {
|
||||||
return QString::fromUtf8("српски екавски");
|
return QString::fromUtf8("српски екавски");
|
||||||
@ -134,19 +134,19 @@ Preferences::Preferences(BrowserWindow* window)
|
|||||||
|
|
||||||
Settings settings;
|
Settings settings;
|
||||||
//GENERAL URLs
|
//GENERAL URLs
|
||||||
settings.beginGroup("Web-URL-Settings");
|
settings.beginGroup(QSL("Web-URL-Settings"));
|
||||||
m_homepage = settings.value("homepage", QUrl(QSL("falkon:start"))).toUrl();
|
m_homepage = settings.value(QSL("homepage"), QUrl(QSL("falkon:start"))).toUrl();
|
||||||
m_newTabUrl = settings.value("newTabUrl", QUrl(QSL("falkon:speeddial"))).toUrl();
|
m_newTabUrl = settings.value(QSL("newTabUrl"), QUrl(QSL("falkon:speeddial"))).toUrl();
|
||||||
ui->homepage->setText(m_homepage.toEncoded());
|
ui->homepage->setText(QString::fromUtf8(m_homepage.toEncoded()));
|
||||||
ui->newTabUrl->setText(m_newTabUrl.toEncoded());
|
ui->newTabUrl->setText(QString::fromUtf8(m_newTabUrl.toEncoded()));
|
||||||
settings.endGroup();
|
settings.endGroup();
|
||||||
ui->afterLaunch->setCurrentIndex(mApp->afterLaunch());
|
ui->afterLaunch->setCurrentIndex(mApp->afterLaunch());
|
||||||
ui->checkUpdates->setChecked(settings.value("Web-Browser-Settings/CheckUpdates", true).toBool());
|
ui->checkUpdates->setChecked(settings.value(QSL("Web-Browser-Settings/CheckUpdates"), true).toBool());
|
||||||
ui->dontLoadTabsUntilSelected->setChecked(settings.value("Web-Browser-Settings/LoadTabsOnActivation", true).toBool());
|
ui->dontLoadTabsUntilSelected->setChecked(settings.value(QSL("Web-Browser-Settings/LoadTabsOnActivation"), true).toBool());
|
||||||
|
|
||||||
#if defined(Q_OS_WIN) && !defined(Q_OS_OS2)
|
#if defined(Q_OS_WIN) && !defined(Q_OS_OS2)
|
||||||
if (!mApp->isPortable()) {
|
if (!mApp->isPortable()) {
|
||||||
ui->checkDefaultBrowser->setChecked(settings.value("Web-Browser-Settings/CheckDefaultBrowser",
|
ui->checkDefaultBrowser->setChecked(settings.value(QSL("Web-Browser-Settings/CheckDefaultBrowser"),
|
||||||
DEFAULT_CHECK_DEFAULTBROWSER).toBool());
|
DEFAULT_CHECK_DEFAULTBROWSER).toBool());
|
||||||
if (mApp->associationManager()->isDefaultForAllCapabilities()) {
|
if (mApp->associationManager()->isDefaultForAllCapabilities()) {
|
||||||
ui->checkNowDefaultBrowser->setText(tr("Default"));
|
ui->checkNowDefaultBrowser->setText(tr("Default"));
|
||||||
@ -215,141 +215,141 @@ Preferences::Preferences(BrowserWindow* window)
|
|||||||
startProfileIndexChanged(ui->startProfile->currentIndex());
|
startProfileIndexChanged(ui->startProfile->currentIndex());
|
||||||
|
|
||||||
//APPEREANCE
|
//APPEREANCE
|
||||||
settings.beginGroup("Browser-View-Settings");
|
settings.beginGroup(QSL("Browser-View-Settings"));
|
||||||
ui->showStatusbar->setChecked(settings.value("showStatusBar", false).toBool());
|
ui->showStatusbar->setChecked(settings.value(QSL("showStatusBar"), false).toBool());
|
||||||
// NOTE: instantBookmarksToolbar and showBookmarksToolbar cannot be both enabled at the same time
|
// NOTE: instantBookmarksToolbar and showBookmarksToolbar cannot be both enabled at the same time
|
||||||
ui->instantBookmarksToolbar->setChecked(settings.value("instantBookmarksToolbar", false).toBool());
|
ui->instantBookmarksToolbar->setChecked(settings.value(QSL("instantBookmarksToolbar"), false).toBool());
|
||||||
ui->showBookmarksToolbar->setChecked(settings.value("showBookmarksToolbar", false).toBool());
|
ui->showBookmarksToolbar->setChecked(settings.value(QSL("showBookmarksToolbar"), false).toBool());
|
||||||
ui->instantBookmarksToolbar->setDisabled(settings.value("showBookmarksToolbar", false).toBool());
|
ui->instantBookmarksToolbar->setDisabled(settings.value(QSL("showBookmarksToolbar"), false).toBool());
|
||||||
ui->showBookmarksToolbar->setDisabled(settings.value("instantBookmarksToolbar").toBool());
|
ui->showBookmarksToolbar->setDisabled(settings.value(QSL("instantBookmarksToolbar")).toBool());
|
||||||
connect(ui->instantBookmarksToolbar, &QAbstractButton::toggled, ui->showBookmarksToolbar, &QWidget::setDisabled);
|
connect(ui->instantBookmarksToolbar, &QAbstractButton::toggled, ui->showBookmarksToolbar, &QWidget::setDisabled);
|
||||||
connect(ui->showBookmarksToolbar, &QAbstractButton::toggled, ui->instantBookmarksToolbar, &QWidget::setDisabled);
|
connect(ui->showBookmarksToolbar, &QAbstractButton::toggled, ui->instantBookmarksToolbar, &QWidget::setDisabled);
|
||||||
ui->showNavigationToolbar->setChecked(settings.value("showNavigationToolbar", true).toBool());
|
ui->showNavigationToolbar->setChecked(settings.value(QSL("showNavigationToolbar"), true).toBool());
|
||||||
int currentSettingsPage = settings.value("settingsDialogPage", 0).toInt(0);
|
int currentSettingsPage = settings.value(QSL("settingsDialogPage"), 0).toInt(0);
|
||||||
settings.endGroup();
|
settings.endGroup();
|
||||||
|
|
||||||
//TABS
|
//TABS
|
||||||
settings.beginGroup("Browser-Tabs-Settings");
|
settings.beginGroup(QSL("Browser-Tabs-Settings"));
|
||||||
ui->hideTabsOnTab->setChecked(settings.value("hideTabsWithOneTab", false).toBool());
|
ui->hideTabsOnTab->setChecked(settings.value(QSL("hideTabsWithOneTab"), false).toBool());
|
||||||
ui->activateLastTab->setChecked(settings.value("ActivateLastTabWhenClosingActual", false).toBool());
|
ui->activateLastTab->setChecked(settings.value(QSL("ActivateLastTabWhenClosingActual"), false).toBool());
|
||||||
ui->openNewTabAfterActive->setChecked(settings.value("newTabAfterActive", true).toBool());
|
ui->openNewTabAfterActive->setChecked(settings.value(QSL("newTabAfterActive"), true).toBool());
|
||||||
ui->openNewEmptyTabAfterActive->setChecked(settings.value("newEmptyTabAfterActive", false).toBool());
|
ui->openNewEmptyTabAfterActive->setChecked(settings.value(QSL("newEmptyTabAfterActive"), false).toBool());
|
||||||
ui->openPopupsInTabs->setChecked(settings.value("OpenPopupsInTabs", false).toBool());
|
ui->openPopupsInTabs->setChecked(settings.value(QSL("OpenPopupsInTabs"), false).toBool());
|
||||||
ui->alwaysSwitchTabsWithWheel->setChecked(settings.value("AlwaysSwitchTabsWithWheel", false).toBool());
|
ui->alwaysSwitchTabsWithWheel->setChecked(settings.value(QSL("AlwaysSwitchTabsWithWheel"), false).toBool());
|
||||||
ui->switchToNewTabs->setChecked(settings.value("OpenNewTabsSelected", false).toBool());
|
ui->switchToNewTabs->setChecked(settings.value(QSL("OpenNewTabsSelected"), false).toBool());
|
||||||
ui->dontCloseOnLastTab->setChecked(settings.value("dontCloseWithOneTab", false).toBool());
|
ui->dontCloseOnLastTab->setChecked(settings.value(QSL("dontCloseWithOneTab"), false).toBool());
|
||||||
ui->askWhenClosingMultipleTabs->setChecked(settings.value("AskOnClosing", false).toBool());
|
ui->askWhenClosingMultipleTabs->setChecked(settings.value(QSL("AskOnClosing"), false).toBool());
|
||||||
ui->showClosedTabsButton->setChecked(settings.value("showClosedTabsButton", false).toBool());
|
ui->showClosedTabsButton->setChecked(settings.value(QSL("showClosedTabsButton"), false).toBool());
|
||||||
ui->showCloseOnInactive->setCurrentIndex(settings.value("showCloseOnInactiveTabs", 0).toInt());
|
ui->showCloseOnInactive->setCurrentIndex(settings.value(QSL("showCloseOnInactiveTabs"), 0).toInt());
|
||||||
settings.endGroup();
|
settings.endGroup();
|
||||||
|
|
||||||
//AddressBar
|
//AddressBar
|
||||||
settings.beginGroup("AddressBar");
|
settings.beginGroup(QSL("AddressBar"));
|
||||||
ui->addressbarCompletion->setCurrentIndex(settings.value("showSuggestions", 0).toInt());
|
ui->addressbarCompletion->setCurrentIndex(settings.value(QSL("showSuggestions"), 0).toInt());
|
||||||
ui->useInlineCompletion->setChecked(settings.value("useInlineCompletion", true).toBool());
|
ui->useInlineCompletion->setChecked(settings.value(QSL("useInlineCompletion"), true).toBool());
|
||||||
ui->completionShowSwitchTab->setChecked(settings.value("showSwitchTab", true).toBool());
|
ui->completionShowSwitchTab->setChecked(settings.value(QSL("showSwitchTab"), true).toBool());
|
||||||
ui->alwaysShowGoIcon->setChecked(settings.value("alwaysShowGoIcon", false).toBool());
|
ui->alwaysShowGoIcon->setChecked(settings.value(QSL("alwaysShowGoIcon"), false).toBool());
|
||||||
ui->showZoomLabel->setChecked(settings.value("showZoomLabel", true).toBool());
|
ui->showZoomLabel->setChecked(settings.value(QSL("showZoomLabel"), true).toBool());
|
||||||
ui->selectAllOnFocus->setChecked(settings.value("SelectAllTextOnDoubleClick", true).toBool());
|
ui->selectAllOnFocus->setChecked(settings.value(QSL("SelectAllTextOnDoubleClick"), true).toBool());
|
||||||
ui->selectAllOnClick->setChecked(settings.value("SelectAllTextOnClick", false).toBool());
|
ui->selectAllOnClick->setChecked(settings.value(QSL("SelectAllTextOnClick"), false).toBool());
|
||||||
ui->completionPopupExpandToWindow->setChecked(settings.value("CompletionPopupExpandToWindow", false).toBool());
|
ui->completionPopupExpandToWindow->setChecked(settings.value(QSL("CompletionPopupExpandToWindow"), false).toBool());
|
||||||
bool showPBinAB = settings.value("ShowLoadingProgress", false).toBool();
|
bool showPBinAB = settings.value(QSL("ShowLoadingProgress"), false).toBool();
|
||||||
ui->showLoadingInAddressBar->setChecked(showPBinAB);
|
ui->showLoadingInAddressBar->setChecked(showPBinAB);
|
||||||
ui->adressProgressSettings->setEnabled(showPBinAB);
|
ui->adressProgressSettings->setEnabled(showPBinAB);
|
||||||
ui->progressStyleSelector->setCurrentIndex(settings.value("ProgressStyle", 0).toInt());
|
ui->progressStyleSelector->setCurrentIndex(settings.value(QSL("ProgressStyle"), 0).toInt());
|
||||||
bool pbInABuseCC = settings.value("UseCustomProgressColor", false).toBool();
|
bool pbInABuseCC = settings.value(QSL("UseCustomProgressColor"), false).toBool();
|
||||||
ui->checkBoxCustomProgressColor->setChecked(pbInABuseCC);
|
ui->checkBoxCustomProgressColor->setChecked(pbInABuseCC);
|
||||||
ui->progressBarColorSelector->setEnabled(pbInABuseCC);
|
ui->progressBarColorSelector->setEnabled(pbInABuseCC);
|
||||||
QColor pbColor = settings.value("CustomProgressColor", palette().color(QPalette::Highlight)).value<QColor>();
|
QColor pbColor = settings.value(QSL("CustomProgressColor"), palette().color(QPalette::Highlight)).value<QColor>();
|
||||||
setProgressBarColorIcon(pbColor);
|
setProgressBarColorIcon(pbColor);
|
||||||
connect(ui->customColorToolButton, &QAbstractButton::clicked, this, &Preferences::selectCustomProgressBarColor);
|
connect(ui->customColorToolButton, &QAbstractButton::clicked, this, &Preferences::selectCustomProgressBarColor);
|
||||||
connect(ui->resetProgressBarcolor, SIGNAL(clicked()), SLOT(setProgressBarColorIcon()));
|
connect(ui->resetProgressBarcolor, SIGNAL(clicked()), SLOT(setProgressBarColorIcon()));
|
||||||
settings.endGroup();
|
settings.endGroup();
|
||||||
|
|
||||||
settings.beginGroup("SearchEngines");
|
settings.beginGroup(QSL("SearchEngines"));
|
||||||
bool searchFromAB = settings.value("SearchFromAddressBar", true).toBool();
|
bool searchFromAB = settings.value(QSL("SearchFromAddressBar"), true).toBool();
|
||||||
ui->searchFromAddressBar->setChecked(searchFromAB);
|
ui->searchFromAddressBar->setChecked(searchFromAB);
|
||||||
ui->searchWithDefaultEngine->setEnabled(searchFromAB);
|
ui->searchWithDefaultEngine->setEnabled(searchFromAB);
|
||||||
ui->searchWithDefaultEngine->setChecked(settings.value("SearchWithDefaultEngine", true).toBool());
|
ui->searchWithDefaultEngine->setChecked(settings.value(QSL("SearchWithDefaultEngine"), true).toBool());
|
||||||
ui->showABSearchSuggestions->setEnabled(searchFromAB);
|
ui->showABSearchSuggestions->setEnabled(searchFromAB);
|
||||||
ui->showABSearchSuggestions->setChecked(settings.value("showSearchSuggestions", true).toBool());
|
ui->showABSearchSuggestions->setChecked(settings.value(QSL("showSearchSuggestions"), true).toBool());
|
||||||
connect(ui->searchFromAddressBar, &QAbstractButton::toggled, this, &Preferences::searchFromAddressBarChanged);
|
connect(ui->searchFromAddressBar, &QAbstractButton::toggled, this, &Preferences::searchFromAddressBarChanged);
|
||||||
settings.endGroup();
|
settings.endGroup();
|
||||||
|
|
||||||
// BROWSING
|
// BROWSING
|
||||||
settings.beginGroup("Web-Browser-Settings");
|
settings.beginGroup(QSL("Web-Browser-Settings"));
|
||||||
ui->allowPlugins->setChecked(settings.value("allowPlugins", true).toBool());
|
ui->allowPlugins->setChecked(settings.value(QSL("allowPlugins"), true).toBool());
|
||||||
connect(ui->allowPlugins, &QAbstractButton::toggled, this, &Preferences::allowPluginsToggled);
|
connect(ui->allowPlugins, &QAbstractButton::toggled, this, &Preferences::allowPluginsToggled);
|
||||||
ui->allowJavaScript->setChecked(settings.value("allowJavaScript", true).toBool());
|
ui->allowJavaScript->setChecked(settings.value(QSL("allowJavaScript"), true).toBool());
|
||||||
ui->linksInFocusChain->setChecked(settings.value("IncludeLinkInFocusChain", false).toBool());
|
ui->linksInFocusChain->setChecked(settings.value(QSL("IncludeLinkInFocusChain"), false).toBool());
|
||||||
ui->spatialNavigation->setChecked(settings.value("SpatialNavigation", false).toBool());
|
ui->spatialNavigation->setChecked(settings.value(QSL("SpatialNavigation"), false).toBool());
|
||||||
ui->animateScrolling->setChecked(settings.value("AnimateScrolling", true).toBool());
|
ui->animateScrolling->setChecked(settings.value(QSL("AnimateScrolling"), true).toBool());
|
||||||
ui->wheelScroll->setValue(settings.value("wheelScrollLines", qApp->wheelScrollLines()).toInt());
|
ui->wheelScroll->setValue(settings.value(QSL("wheelScrollLines"), qApp->wheelScrollLines()).toInt());
|
||||||
ui->xssAuditing->setChecked(settings.value("XSSAuditing", false).toBool());
|
ui->xssAuditing->setChecked(settings.value(QSL("XSSAuditing"), false).toBool());
|
||||||
ui->printEBackground->setChecked(settings.value("PrintElementBackground", true).toBool());
|
ui->printEBackground->setChecked(settings.value(QSL("PrintElementBackground"), true).toBool());
|
||||||
ui->useNativeScrollbars->setChecked(settings.value("UseNativeScrollbars", false).toBool());
|
ui->useNativeScrollbars->setChecked(settings.value(QSL("UseNativeScrollbars"), false).toBool());
|
||||||
ui->disableVideoAutoPlay->setChecked(settings.value("DisableVideoAutoPlay", false).toBool());
|
ui->disableVideoAutoPlay->setChecked(settings.value(QSL("DisableVideoAutoPlay"), false).toBool());
|
||||||
ui->webRTCPublicIpOnly->setChecked(settings.value("WebRTCPublicIpOnly", true).toBool());
|
ui->webRTCPublicIpOnly->setChecked(settings.value(QSL("WebRTCPublicIpOnly"), true).toBool());
|
||||||
ui->dnsPrefetch->setChecked(settings.value("DNSPrefetch", true).toBool());
|
ui->dnsPrefetch->setChecked(settings.value(QSL("DNSPrefetch"), true).toBool());
|
||||||
ui->intPDFViewer->setChecked(settings.value("intPDFViewer", false).toBool());
|
ui->intPDFViewer->setChecked(settings.value(QSL("intPDFViewer"), false).toBool());
|
||||||
ui->intPDFViewer->setEnabled(ui->allowPlugins->isChecked());
|
ui->intPDFViewer->setEnabled(ui->allowPlugins->isChecked());
|
||||||
ui->screenCaptureEnabled->setChecked(settings.value("screenCaptureEnabled", false).toBool());
|
ui->screenCaptureEnabled->setChecked(settings.value(QSL("screenCaptureEnabled"), false).toBool());
|
||||||
ui->hardwareAccel->setChecked(settings.value("hardwareAccel", false).toBool());
|
ui->hardwareAccel->setChecked(settings.value(QSL("hardwareAccel"), false).toBool());
|
||||||
|
|
||||||
const auto levels = WebView::zoomLevels();
|
const auto levels = WebView::zoomLevels();
|
||||||
for (int level : levels) {
|
for (int level : levels) {
|
||||||
ui->defaultZoomLevel->addItem(tr("%1%").arg(QString::number(level)));
|
ui->defaultZoomLevel->addItem(tr("%1%").arg(QString::number(level)));
|
||||||
}
|
}
|
||||||
ui->defaultZoomLevel->setCurrentIndex(settings.value("DefaultZoomLevel", WebView::zoomLevels().indexOf(100)).toInt());
|
ui->defaultZoomLevel->setCurrentIndex(settings.value(QSL("DefaultZoomLevel"), WebView::zoomLevels().indexOf(100)).toInt());
|
||||||
ui->closeAppWithCtrlQ->setChecked(settings.value("closeAppWithCtrlQ", true).toBool());
|
ui->closeAppWithCtrlQ->setChecked(settings.value(QSL("closeAppWithCtrlQ"), true).toBool());
|
||||||
|
|
||||||
//Cache
|
//Cache
|
||||||
ui->allowCache->setChecked(settings.value("AllowLocalCache", true).toBool());
|
ui->allowCache->setChecked(settings.value(QSL("AllowLocalCache"), true).toBool());
|
||||||
ui->removeCache->setChecked(settings.value("deleteCacheOnClose", false).toBool());
|
ui->removeCache->setChecked(settings.value(QSL("deleteCacheOnClose"), false).toBool());
|
||||||
ui->cacheMB->setValue(settings.value("LocalCacheSize", 50).toInt());
|
ui->cacheMB->setValue(settings.value(QSL("LocalCacheSize"), 50).toInt());
|
||||||
ui->cachePath->setText(settings.value("CachePath", mApp->webProfile()->cachePath()).toString());
|
ui->cachePath->setText(settings.value(QSL("CachePath"), mApp->webProfile()->cachePath()).toString());
|
||||||
connect(ui->allowCache, &QAbstractButton::clicked, this, &Preferences::allowCacheChanged);
|
connect(ui->allowCache, &QAbstractButton::clicked, this, &Preferences::allowCacheChanged);
|
||||||
connect(ui->changeCachePath, &QAbstractButton::clicked, this, &Preferences::changeCachePathClicked);
|
connect(ui->changeCachePath, &QAbstractButton::clicked, this, &Preferences::changeCachePathClicked);
|
||||||
allowCacheChanged(ui->allowCache->isChecked());
|
allowCacheChanged(ui->allowCache->isChecked());
|
||||||
|
|
||||||
//PASSWORD MANAGER
|
//PASSWORD MANAGER
|
||||||
ui->allowPassManager->setChecked(settings.value("SavePasswordsOnSites", true).toBool());
|
ui->allowPassManager->setChecked(settings.value(QSL("SavePasswordsOnSites"), true).toBool());
|
||||||
ui->autoCompletePasswords->setChecked(settings.value("AutoCompletePasswords", true).toBool());
|
ui->autoCompletePasswords->setChecked(settings.value(QSL("AutoCompletePasswords"), true).toBool());
|
||||||
|
|
||||||
//PRIVACY
|
//PRIVACY
|
||||||
//Web storage
|
//Web storage
|
||||||
ui->saveHistory->setChecked(settings.value("allowHistory", true).toBool());
|
ui->saveHistory->setChecked(settings.value(QSL("allowHistory"), true).toBool());
|
||||||
ui->deleteHistoryOnClose->setChecked(settings.value("deleteHistoryOnClose", false).toBool());
|
ui->deleteHistoryOnClose->setChecked(settings.value(QSL("deleteHistoryOnClose"), false).toBool());
|
||||||
if (!ui->saveHistory->isChecked()) {
|
if (!ui->saveHistory->isChecked()) {
|
||||||
ui->deleteHistoryOnClose->setEnabled(false);
|
ui->deleteHistoryOnClose->setEnabled(false);
|
||||||
}
|
}
|
||||||
connect(ui->saveHistory, &QAbstractButton::toggled, this, &Preferences::saveHistoryChanged);
|
connect(ui->saveHistory, &QAbstractButton::toggled, this, &Preferences::saveHistoryChanged);
|
||||||
|
|
||||||
// Html5Storage
|
// Html5Storage
|
||||||
ui->html5storage->setChecked(settings.value("HTML5StorageEnabled", true).toBool());
|
ui->html5storage->setChecked(settings.value(QSL("HTML5StorageEnabled"), true).toBool());
|
||||||
ui->deleteHtml5storageOnClose->setChecked(settings.value("deleteHTML5StorageOnClose", false).toBool());
|
ui->deleteHtml5storageOnClose->setChecked(settings.value(QSL("deleteHTML5StorageOnClose"), false).toBool());
|
||||||
connect(ui->html5storage, &QAbstractButton::toggled, this, &Preferences::allowHtml5storageChanged);
|
connect(ui->html5storage, &QAbstractButton::toggled, this, &Preferences::allowHtml5storageChanged);
|
||||||
// Other
|
// Other
|
||||||
ui->doNotTrack->setChecked(settings.value("DoNotTrack", false).toBool());
|
ui->doNotTrack->setChecked(settings.value(QSL("DoNotTrack"), false).toBool());
|
||||||
|
|
||||||
//CSS Style
|
//CSS Style
|
||||||
ui->userStyleSheet->setText(settings.value("userStyleSheet", "").toString());
|
ui->userStyleSheet->setText(settings.value(QSL("userStyleSheet"), QSL("")).toString());
|
||||||
connect(ui->chooseUserStylesheet, &QAbstractButton::clicked, this, &Preferences::chooseUserStyleClicked);
|
connect(ui->chooseUserStylesheet, &QAbstractButton::clicked, this, &Preferences::chooseUserStyleClicked);
|
||||||
settings.endGroup();
|
settings.endGroup();
|
||||||
|
|
||||||
//DOWNLOADS
|
//DOWNLOADS
|
||||||
settings.beginGroup("DownloadManager");
|
settings.beginGroup(QSL("DownloadManager"));
|
||||||
ui->downLoc->setText(settings.value("defaultDownloadPath", "").toString());
|
ui->downLoc->setText(settings.value(QSL("defaultDownloadPath"), QSL("")).toString());
|
||||||
ui->closeDownManOnFinish->setChecked(settings.value("CloseManagerOnFinish", false).toBool());
|
ui->closeDownManOnFinish->setChecked(settings.value(QSL("CloseManagerOnFinish"), false).toBool());
|
||||||
if (ui->downLoc->text().isEmpty()) {
|
if (ui->downLoc->text().isEmpty()) {
|
||||||
ui->askEverytime->setChecked(true);
|
ui->askEverytime->setChecked(true);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
ui->useDefined->setChecked(true);
|
ui->useDefined->setChecked(true);
|
||||||
}
|
}
|
||||||
ui->useExternalDownManager->setChecked(settings.value("UseExternalManager", false).toBool());
|
ui->useExternalDownManager->setChecked(settings.value(QSL("UseExternalManager"), false).toBool());
|
||||||
ui->externalDownExecutable->setText(settings.value("ExternalManagerExecutable", "").toString());
|
ui->externalDownExecutable->setText(settings.value(QSL("ExternalManagerExecutable"), QSL("")).toString());
|
||||||
ui->externalDownArguments->setText(settings.value("ExternalManagerArguments", "").toString());
|
ui->externalDownArguments->setText(settings.value(QSL("ExternalManagerArguments"), QSL("")).toString());
|
||||||
|
|
||||||
connect(ui->useExternalDownManager, &QAbstractButton::toggled, this, &Preferences::useExternalDownManagerChanged);
|
connect(ui->useExternalDownManager, &QAbstractButton::toggled, this, &Preferences::useExternalDownManagerChanged);
|
||||||
|
|
||||||
@ -362,7 +362,7 @@ Preferences::Preferences(BrowserWindow* window)
|
|||||||
settings.endGroup();
|
settings.endGroup();
|
||||||
|
|
||||||
//FONTS
|
//FONTS
|
||||||
settings.beginGroup("Browser-Fonts");
|
settings.beginGroup(QSL("Browser-Fonts"));
|
||||||
QWebEngineSettings* webSettings = mApp->webSettings();
|
QWebEngineSettings* webSettings = mApp->webSettings();
|
||||||
auto defaultFont = [&](QWebEngineSettings::FontFamily font) -> const QString {
|
auto defaultFont = [&](QWebEngineSettings::FontFamily font) -> const QString {
|
||||||
const QString family = webSettings->fontFamily(font);
|
const QString family = webSettings->fontFamily(font);
|
||||||
@ -377,33 +377,33 @@ Preferences::Preferences(BrowserWindow* window)
|
|||||||
return QFontDatabase::systemFont(QFontDatabase::GeneralFont).family();
|
return QFontDatabase::systemFont(QFontDatabase::GeneralFont).family();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
ui->fontStandard->setCurrentFont(QFont(settings.value("StandardFont", defaultFont(QWebEngineSettings::StandardFont)).toString()));
|
ui->fontStandard->setCurrentFont(QFont(settings.value(QSL("StandardFont"), defaultFont(QWebEngineSettings::StandardFont)).toString()));
|
||||||
ui->fontCursive->setCurrentFont(QFont(settings.value("CursiveFont", defaultFont(QWebEngineSettings::CursiveFont)).toString()));
|
ui->fontCursive->setCurrentFont(QFont(settings.value(QSL("CursiveFont"), defaultFont(QWebEngineSettings::CursiveFont)).toString()));
|
||||||
ui->fontFantasy->setCurrentFont(QFont(settings.value("FantasyFont", defaultFont(QWebEngineSettings::FantasyFont)).toString()));
|
ui->fontFantasy->setCurrentFont(QFont(settings.value(QSL("FantasyFont"), defaultFont(QWebEngineSettings::FantasyFont)).toString()));
|
||||||
ui->fontFixed->setCurrentFont(QFont(settings.value("FixedFont", defaultFont(QWebEngineSettings::FixedFont)).toString()));
|
ui->fontFixed->setCurrentFont(QFont(settings.value(QSL("FixedFont"), defaultFont(QWebEngineSettings::FixedFont)).toString()));
|
||||||
ui->fontSansSerif->setCurrentFont(QFont(settings.value("SansSerifFont", defaultFont(QWebEngineSettings::SansSerifFont)).toString()));
|
ui->fontSansSerif->setCurrentFont(QFont(settings.value(QSL("SansSerifFont"), defaultFont(QWebEngineSettings::SansSerifFont)).toString()));
|
||||||
ui->fontSerif->setCurrentFont(QFont(settings.value("SerifFont", defaultFont(QWebEngineSettings::SerifFont)).toString()));
|
ui->fontSerif->setCurrentFont(QFont(settings.value(QSL("SerifFont"), defaultFont(QWebEngineSettings::SerifFont)).toString()));
|
||||||
ui->sizeDefault->setValue(settings.value("DefaultFontSize", webSettings->fontSize(QWebEngineSettings::DefaultFontSize)).toInt());
|
ui->sizeDefault->setValue(settings.value(QSL("DefaultFontSize"), webSettings->fontSize(QWebEngineSettings::DefaultFontSize)).toInt());
|
||||||
ui->sizeFixed->setValue(settings.value("FixedFontSize", webSettings->fontSize(QWebEngineSettings::DefaultFixedFontSize)).toInt());
|
ui->sizeFixed->setValue(settings.value(QSL("FixedFontSize"), webSettings->fontSize(QWebEngineSettings::DefaultFixedFontSize)).toInt());
|
||||||
ui->sizeMinimum->setValue(settings.value("MinimumFontSize", webSettings->fontSize(QWebEngineSettings::MinimumFontSize)).toInt());
|
ui->sizeMinimum->setValue(settings.value(QSL("MinimumFontSize"), webSettings->fontSize(QWebEngineSettings::MinimumFontSize)).toInt());
|
||||||
ui->sizeMinimumLogical->setValue(settings.value("MinimumLogicalFontSize", webSettings->fontSize(QWebEngineSettings::MinimumLogicalFontSize)).toInt());
|
ui->sizeMinimumLogical->setValue(settings.value(QSL("MinimumLogicalFontSize"), webSettings->fontSize(QWebEngineSettings::MinimumLogicalFontSize)).toInt());
|
||||||
settings.endGroup();
|
settings.endGroup();
|
||||||
|
|
||||||
//KEYBOARD SHORTCUTS
|
//KEYBOARD SHORTCUTS
|
||||||
settings.beginGroup("Shortcuts");
|
settings.beginGroup(QSL("Shortcuts"));
|
||||||
ui->switchTabsAlt->setChecked(settings.value("useTabNumberShortcuts", true).toBool());
|
ui->switchTabsAlt->setChecked(settings.value(QSL("useTabNumberShortcuts"), true).toBool());
|
||||||
ui->loadSpeedDialsCtrl->setChecked(settings.value("useSpeedDialNumberShortcuts", true).toBool());
|
ui->loadSpeedDialsCtrl->setChecked(settings.value(QSL("useSpeedDialNumberShortcuts"), true).toBool());
|
||||||
ui->singleKeyShortcuts->setChecked(settings.value("useSingleKeyShortcuts", false).toBool());
|
ui->singleKeyShortcuts->setChecked(settings.value(QSL("useSingleKeyShortcuts"), false).toBool());
|
||||||
settings.endGroup();
|
settings.endGroup();
|
||||||
|
|
||||||
//NOTIFICATIONS
|
//NOTIFICATIONS
|
||||||
ui->useNativeSystemNotifications->setEnabled(mApp->desktopNotifications()->supportsNativeNotifications());
|
ui->useNativeSystemNotifications->setEnabled(mApp->desktopNotifications()->supportsNativeNotifications());
|
||||||
|
|
||||||
DesktopNotificationsFactory::Type notifyType;
|
DesktopNotificationsFactory::Type notifyType;
|
||||||
settings.beginGroup("Notifications");
|
settings.beginGroup(QSL("Notifications"));
|
||||||
ui->notificationTimeout->setValue(settings.value("Timeout", 6000).toInt() / 1000);
|
ui->notificationTimeout->setValue(settings.value(QSL("Timeout"), 6000).toInt() / 1000);
|
||||||
#if defined(Q_OS_UNIX) && !defined(DISABLE_DBUS)
|
#if defined(Q_OS_UNIX) && !defined(DISABLE_DBUS)
|
||||||
notifyType = settings.value("UseNativeDesktop", true).toBool() ? DesktopNotificationsFactory::DesktopNative : DesktopNotificationsFactory::PopupWidget;
|
notifyType = settings.value(QSL("UseNativeDesktop"), true).toBool() ? DesktopNotificationsFactory::DesktopNative : DesktopNotificationsFactory::PopupWidget;
|
||||||
#else
|
#else
|
||||||
notifyType = DesktopNotificationsFactory::PopupWidget;
|
notifyType = DesktopNotificationsFactory::PopupWidget;
|
||||||
#endif
|
#endif
|
||||||
@ -416,8 +416,8 @@ Preferences::Preferences(BrowserWindow* window)
|
|||||||
|
|
||||||
connect(ui->notificationPreview, &QPushButton::clicked, this, &Preferences::showNotificationPreview);
|
connect(ui->notificationPreview, &QPushButton::clicked, this, &Preferences::showNotificationPreview);
|
||||||
|
|
||||||
ui->doNotUseNotifications->setChecked(!settings.value("Enabled", true).toBool());
|
ui->doNotUseNotifications->setChecked(!settings.value(QSL("Enabled"), true).toBool());
|
||||||
m_notifPosition = settings.value("Position", QPoint(10, 10)).toPoint();
|
m_notifPosition = settings.value(QSL("Position"), QPoint(10, 10)).toPoint();
|
||||||
settings.endGroup();
|
settings.endGroup();
|
||||||
|
|
||||||
//SPELLCHECK
|
//SPELLCHECK
|
||||||
@ -488,8 +488,8 @@ Preferences::Preferences(BrowserWindow* window)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Proxy Configuration
|
// Proxy Configuration
|
||||||
settings.beginGroup("Web-Proxy");
|
settings.beginGroup(QSL("Web-Proxy"));
|
||||||
int proxyType = settings.value("ProxyType", 2).toInt();
|
int proxyType = settings.value(QSL("ProxyType"), 2).toInt();
|
||||||
if (proxyType == 0) {
|
if (proxyType == 0) {
|
||||||
ui->noProxy->setChecked(true);
|
ui->noProxy->setChecked(true);
|
||||||
} else if (proxyType == 2) {
|
} else if (proxyType == 2) {
|
||||||
@ -502,10 +502,10 @@ Preferences::Preferences(BrowserWindow* window)
|
|||||||
ui->proxyType->setCurrentIndex(1);
|
ui->proxyType->setCurrentIndex(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
ui->proxyServer->setText(settings.value("HostName", "").toString());
|
ui->proxyServer->setText(settings.value(QSL("HostName"), QSL("")).toString());
|
||||||
ui->proxyPort->setText(settings.value("Port", 8080).toString());
|
ui->proxyPort->setText(settings.value(QSL("Port"), 8080).toString());
|
||||||
ui->proxyUsername->setText(settings.value("Username", "").toString());
|
ui->proxyUsername->setText(settings.value(QSL("Username"), QSL("")).toString());
|
||||||
ui->proxyPassword->setText(settings.value("Password", "").toString());
|
ui->proxyPassword->setText(settings.value(QSL("Password"), QSL("")).toString());
|
||||||
settings.endGroup();
|
settings.endGroup();
|
||||||
|
|
||||||
setManualProxyConfigurationEnabled(ui->manualProxy->isChecked());
|
setManualProxyConfigurationEnabled(ui->manualProxy->isChecked());
|
||||||
@ -543,7 +543,7 @@ Preferences::Preferences(BrowserWindow* window)
|
|||||||
restoreGeometry(settings.value(QSL("Geometry")).toByteArray());
|
restoreGeometry(settings.value(QSL("Geometry")).toByteArray());
|
||||||
settings.endGroup();
|
settings.endGroup();
|
||||||
|
|
||||||
QzTools::setWmClass("Preferences", this);
|
QzTools::setWmClass(QSL("Preferences"), this);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Preferences::allowPluginsToggled(bool checked)
|
void Preferences::allowPluginsToggled(bool checked)
|
||||||
@ -553,7 +553,7 @@ void Preferences::allowPluginsToggled(bool checked)
|
|||||||
|
|
||||||
void Preferences::chooseExternalDownloadManager()
|
void Preferences::chooseExternalDownloadManager()
|
||||||
{
|
{
|
||||||
QString path = QzTools::getOpenFileName("Preferences-ExternalDownloadManager", this, tr("Choose executable location..."), QDir::homePath());
|
QString path = QzTools::getOpenFileName(QSL("Preferences-ExternalDownloadManager"), this, tr("Choose executable location..."), QDir::homePath());
|
||||||
if (path.isEmpty()) {
|
if (path.isEmpty()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -569,7 +569,7 @@ void Preferences::showStackedPage(QListWidgetItem* item)
|
|||||||
|
|
||||||
int index = ui->listWidget->currentRow();
|
int index = ui->listWidget->currentRow();
|
||||||
|
|
||||||
ui->caption->setText("<b>" + item->text() + "</b>");
|
ui->caption->setText(QSL("<b>") + item->text() + QSL("</b>"));
|
||||||
ui->stackedWidget->setCurrentIndex(index);
|
ui->stackedWidget->setCurrentIndex(index);
|
||||||
|
|
||||||
if (m_notification) {
|
if (m_notification) {
|
||||||
@ -646,7 +646,7 @@ void Preferences::useActualNewTab()
|
|||||||
|
|
||||||
void Preferences::chooseDownPath()
|
void Preferences::chooseDownPath()
|
||||||
{
|
{
|
||||||
QString userFileName = QzTools::getExistingDirectory("Preferences-ChooseDownPath", this, tr("Choose download location..."), QDir::homePath());
|
QString userFileName = QzTools::getExistingDirectory(QSL("Preferences-ChooseDownPath"), this, tr("Choose download location..."), QDir::homePath());
|
||||||
if (userFileName.isEmpty()) {
|
if (userFileName.isEmpty()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -660,7 +660,7 @@ void Preferences::chooseDownPath()
|
|||||||
|
|
||||||
void Preferences::chooseUserStyleClicked()
|
void Preferences::chooseUserStyleClicked()
|
||||||
{
|
{
|
||||||
QString file = QzTools::getOpenFileName("Preferences-UserStyle", this, tr("Choose stylesheet location..."), QDir::homePath(), "*.css");
|
QString file = QzTools::getOpenFileName(QSL("Preferences-UserStyle"), this, tr("Choose stylesheet location..."), QDir::homePath(), QSL("*.css"));
|
||||||
if (file.isEmpty()) {
|
if (file.isEmpty()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -779,7 +779,7 @@ void Preferences::afterLaunchChanged(int value)
|
|||||||
|
|
||||||
void Preferences::changeCachePathClicked()
|
void Preferences::changeCachePathClicked()
|
||||||
{
|
{
|
||||||
QString path = QzTools::getExistingDirectory("Preferences-CachePath", this, tr("Choose cache path..."), ui->cachePath->text());
|
QString path = QzTools::getExistingDirectory(QSL("Preferences-CachePath"), this, tr("Choose cache path..."), ui->cachePath->text());
|
||||||
if (path.isEmpty()) {
|
if (path.isEmpty()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -858,8 +858,8 @@ void Preferences::startProfileIndexChanged(int index)
|
|||||||
void Preferences::closeEvent(QCloseEvent* event)
|
void Preferences::closeEvent(QCloseEvent* event)
|
||||||
{
|
{
|
||||||
Settings settings;
|
Settings settings;
|
||||||
settings.beginGroup("Browser-View-Settings");
|
settings.beginGroup(QSL("Browser-View-Settings"));
|
||||||
settings.setValue("settingsDialogPage", ui->stackedWidget->currentIndex());
|
settings.setValue(QSL("settingsDialogPage"), ui->stackedWidget->currentIndex());
|
||||||
settings.endGroup();
|
settings.endGroup();
|
||||||
|
|
||||||
event->accept();
|
event->accept();
|
||||||
@ -871,25 +871,25 @@ void Preferences::saveSettings()
|
|||||||
//GENERAL URLs
|
//GENERAL URLs
|
||||||
QUrl homepage = QUrl::fromUserInput(ui->homepage->text());
|
QUrl homepage = QUrl::fromUserInput(ui->homepage->text());
|
||||||
|
|
||||||
settings.beginGroup("Web-URL-Settings");
|
settings.beginGroup(QSL("Web-URL-Settings"));
|
||||||
settings.setValue("homepage", homepage);
|
settings.setValue(QSL("homepage"), homepage);
|
||||||
settings.setValue("afterLaunch", ui->afterLaunch->currentIndex());
|
settings.setValue(QSL("afterLaunch"), ui->afterLaunch->currentIndex());
|
||||||
|
|
||||||
switch (ui->newTab->currentIndex()) {
|
switch (ui->newTab->currentIndex()) {
|
||||||
case 0:
|
case 0:
|
||||||
settings.setValue("newTabUrl", QUrl());
|
settings.setValue(QSL("newTabUrl"), QUrl());
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 1:
|
case 1:
|
||||||
settings.setValue("newTabUrl", homepage);
|
settings.setValue(QSL("newTabUrl"), homepage);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 2:
|
case 2:
|
||||||
settings.setValue("newTabUrl", QUrl(QSL("falkon:speeddial")));
|
settings.setValue(QSL("newTabUrl"), QUrl(QSL("falkon:speeddial")));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 3:
|
case 3:
|
||||||
settings.setValue("newTabUrl", QUrl::fromUserInput(ui->newTabUrl->text()));
|
settings.setValue(QSL("newTabUrl"), QUrl::fromUserInput(ui->newTabUrl->text()));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
@ -905,121 +905,121 @@ void Preferences::saveSettings()
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
//WINDOW
|
//WINDOW
|
||||||
settings.beginGroup("Browser-View-Settings");
|
settings.beginGroup(QSL("Browser-View-Settings"));
|
||||||
settings.setValue("showStatusBar", ui->showStatusbar->isChecked());
|
settings.setValue(QSL("showStatusBar"), ui->showStatusbar->isChecked());
|
||||||
settings.setValue("instantBookmarksToolbar", ui->instantBookmarksToolbar->isChecked());
|
settings.setValue(QSL("instantBookmarksToolbar"), ui->instantBookmarksToolbar->isChecked());
|
||||||
settings.setValue("showBookmarksToolbar", ui->showBookmarksToolbar->isChecked());
|
settings.setValue(QSL("showBookmarksToolbar"), ui->showBookmarksToolbar->isChecked());
|
||||||
settings.setValue("showNavigationToolbar", ui->showNavigationToolbar->isChecked());
|
settings.setValue(QSL("showNavigationToolbar"), ui->showNavigationToolbar->isChecked());
|
||||||
settings.endGroup();
|
settings.endGroup();
|
||||||
|
|
||||||
//TABS
|
//TABS
|
||||||
settings.beginGroup("Browser-Tabs-Settings");
|
settings.beginGroup(QSL("Browser-Tabs-Settings"));
|
||||||
settings.setValue("hideTabsWithOneTab", ui->hideTabsOnTab->isChecked());
|
settings.setValue(QSL("hideTabsWithOneTab"), ui->hideTabsOnTab->isChecked());
|
||||||
settings.setValue("ActivateLastTabWhenClosingActual", ui->activateLastTab->isChecked());
|
settings.setValue(QSL("ActivateLastTabWhenClosingActual"), ui->activateLastTab->isChecked());
|
||||||
settings.setValue("newTabAfterActive", ui->openNewTabAfterActive->isChecked());
|
settings.setValue(QSL("newTabAfterActive"), ui->openNewTabAfterActive->isChecked());
|
||||||
settings.setValue("newEmptyTabAfterActive", ui->openNewEmptyTabAfterActive->isChecked());
|
settings.setValue(QSL("newEmptyTabAfterActive"), ui->openNewEmptyTabAfterActive->isChecked());
|
||||||
settings.setValue("OpenPopupsInTabs", ui->openPopupsInTabs->isChecked());
|
settings.setValue(QSL("OpenPopupsInTabs"), ui->openPopupsInTabs->isChecked());
|
||||||
settings.setValue("AlwaysSwitchTabsWithWheel", ui->alwaysSwitchTabsWithWheel->isChecked());
|
settings.setValue(QSL("AlwaysSwitchTabsWithWheel"), ui->alwaysSwitchTabsWithWheel->isChecked());
|
||||||
settings.setValue("OpenNewTabsSelected", ui->switchToNewTabs->isChecked());
|
settings.setValue(QSL("OpenNewTabsSelected"), ui->switchToNewTabs->isChecked());
|
||||||
settings.setValue("dontCloseWithOneTab", ui->dontCloseOnLastTab->isChecked());
|
settings.setValue(QSL("dontCloseWithOneTab"), ui->dontCloseOnLastTab->isChecked());
|
||||||
settings.setValue("AskOnClosing", ui->askWhenClosingMultipleTabs->isChecked());
|
settings.setValue(QSL("AskOnClosing"), ui->askWhenClosingMultipleTabs->isChecked());
|
||||||
settings.setValue("showClosedTabsButton", ui->showClosedTabsButton->isChecked());
|
settings.setValue(QSL("showClosedTabsButton"), ui->showClosedTabsButton->isChecked());
|
||||||
settings.setValue("showCloseOnInactiveTabs", ui->showCloseOnInactive->currentIndex());
|
settings.setValue(QSL("showCloseOnInactiveTabs"), ui->showCloseOnInactive->currentIndex());
|
||||||
settings.endGroup();
|
settings.endGroup();
|
||||||
|
|
||||||
//DOWNLOADS
|
//DOWNLOADS
|
||||||
settings.beginGroup("DownloadManager");
|
settings.beginGroup(QSL("DownloadManager"));
|
||||||
if (ui->askEverytime->isChecked()) {
|
if (ui->askEverytime->isChecked()) {
|
||||||
settings.setValue("defaultDownloadPath", "");
|
settings.setValue(QSL("defaultDownloadPath"), QSL(""));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
settings.setValue("defaultDownloadPath", ui->downLoc->text());
|
settings.setValue(QSL("defaultDownloadPath"), ui->downLoc->text());
|
||||||
}
|
}
|
||||||
settings.setValue("CloseManagerOnFinish", ui->closeDownManOnFinish->isChecked());
|
settings.setValue(QSL("CloseManagerOnFinish"), ui->closeDownManOnFinish->isChecked());
|
||||||
settings.setValue("UseExternalManager", ui->useExternalDownManager->isChecked());
|
settings.setValue(QSL("UseExternalManager"), ui->useExternalDownManager->isChecked());
|
||||||
settings.setValue("ExternalManagerExecutable", ui->externalDownExecutable->text());
|
settings.setValue(QSL("ExternalManagerExecutable"), ui->externalDownExecutable->text());
|
||||||
settings.setValue("ExternalManagerArguments", ui->externalDownArguments->text());
|
settings.setValue(QSL("ExternalManagerArguments"), ui->externalDownArguments->text());
|
||||||
|
|
||||||
settings.endGroup();
|
settings.endGroup();
|
||||||
|
|
||||||
//FONTS
|
//FONTS
|
||||||
settings.beginGroup("Browser-Fonts");
|
settings.beginGroup(QSL("Browser-Fonts"));
|
||||||
settings.setValue("StandardFont", ui->fontStandard->currentFont().family());
|
settings.setValue(QSL("StandardFont"), ui->fontStandard->currentFont().family());
|
||||||
settings.setValue("CursiveFont", ui->fontCursive->currentFont().family());
|
settings.setValue(QSL("CursiveFont"), ui->fontCursive->currentFont().family());
|
||||||
settings.setValue("FantasyFont", ui->fontFantasy->currentFont().family());
|
settings.setValue(QSL("FantasyFont"), ui->fontFantasy->currentFont().family());
|
||||||
settings.setValue("FixedFont", ui->fontFixed->currentFont().family());
|
settings.setValue(QSL("FixedFont"), ui->fontFixed->currentFont().family());
|
||||||
settings.setValue("SansSerifFont", ui->fontSansSerif->currentFont().family());
|
settings.setValue(QSL("SansSerifFont"), ui->fontSansSerif->currentFont().family());
|
||||||
settings.setValue("SerifFont", ui->fontSerif->currentFont().family());
|
settings.setValue(QSL("SerifFont"), ui->fontSerif->currentFont().family());
|
||||||
|
|
||||||
settings.setValue("DefaultFontSize", ui->sizeDefault->value());
|
settings.setValue(QSL("DefaultFontSize"), ui->sizeDefault->value());
|
||||||
settings.setValue("FixedFontSize", ui->sizeFixed->value());
|
settings.setValue(QSL("FixedFontSize"), ui->sizeFixed->value());
|
||||||
settings.setValue("MinimumFontSize", ui->sizeMinimum->value());
|
settings.setValue(QSL("MinimumFontSize"), ui->sizeMinimum->value());
|
||||||
settings.setValue("MinimumLogicalFontSize", ui->sizeMinimumLogical->value());
|
settings.setValue(QSL("MinimumLogicalFontSize"), ui->sizeMinimumLogical->value());
|
||||||
settings.endGroup();
|
settings.endGroup();
|
||||||
|
|
||||||
//KEYBOARD SHORTCUTS
|
//KEYBOARD SHORTCUTS
|
||||||
settings.beginGroup("Shortcuts");
|
settings.beginGroup(QSL("Shortcuts"));
|
||||||
settings.setValue("useTabNumberShortcuts", ui->switchTabsAlt->isChecked());
|
settings.setValue(QSL("useTabNumberShortcuts"), ui->switchTabsAlt->isChecked());
|
||||||
settings.setValue("useSpeedDialNumberShortcuts", ui->loadSpeedDialsCtrl->isChecked());
|
settings.setValue(QSL("useSpeedDialNumberShortcuts"), ui->loadSpeedDialsCtrl->isChecked());
|
||||||
settings.setValue("useSingleKeyShortcuts", ui->singleKeyShortcuts->isChecked());
|
settings.setValue(QSL("useSingleKeyShortcuts"), ui->singleKeyShortcuts->isChecked());
|
||||||
settings.endGroup();
|
settings.endGroup();
|
||||||
|
|
||||||
//BROWSING
|
//BROWSING
|
||||||
settings.beginGroup("Web-Browser-Settings");
|
settings.beginGroup(QSL("Web-Browser-Settings"));
|
||||||
settings.setValue("allowPlugins", ui->allowPlugins->isChecked());
|
settings.setValue(QSL("allowPlugins"), ui->allowPlugins->isChecked());
|
||||||
settings.setValue("allowJavaScript", ui->allowJavaScript->isChecked());
|
settings.setValue(QSL("allowJavaScript"), ui->allowJavaScript->isChecked());
|
||||||
settings.setValue("IncludeLinkInFocusChain", ui->linksInFocusChain->isChecked());
|
settings.setValue(QSL("IncludeLinkInFocusChain"), ui->linksInFocusChain->isChecked());
|
||||||
settings.setValue("SpatialNavigation", ui->spatialNavigation->isChecked());
|
settings.setValue(QSL("SpatialNavigation"), ui->spatialNavigation->isChecked());
|
||||||
settings.setValue("AnimateScrolling", ui->animateScrolling->isChecked());
|
settings.setValue(QSL("AnimateScrolling"), ui->animateScrolling->isChecked());
|
||||||
settings.setValue("wheelScrollLines", ui->wheelScroll->value());
|
settings.setValue(QSL("wheelScrollLines"), ui->wheelScroll->value());
|
||||||
settings.setValue("DoNotTrack", ui->doNotTrack->isChecked());
|
settings.setValue(QSL("DoNotTrack"), ui->doNotTrack->isChecked());
|
||||||
settings.setValue("CheckUpdates", ui->checkUpdates->isChecked());
|
settings.setValue(QSL("CheckUpdates"), ui->checkUpdates->isChecked());
|
||||||
settings.setValue("LoadTabsOnActivation", ui->dontLoadTabsUntilSelected->isChecked());
|
settings.setValue(QSL("LoadTabsOnActivation"), ui->dontLoadTabsUntilSelected->isChecked());
|
||||||
settings.setValue("DefaultZoomLevel", ui->defaultZoomLevel->currentIndex());
|
settings.setValue(QSL("DefaultZoomLevel"), ui->defaultZoomLevel->currentIndex());
|
||||||
settings.setValue("XSSAuditing", ui->xssAuditing->isChecked());
|
settings.setValue(QSL("XSSAuditing"), ui->xssAuditing->isChecked());
|
||||||
settings.setValue("PrintElementBackground", ui->printEBackground->isChecked());
|
settings.setValue(QSL("PrintElementBackground"), ui->printEBackground->isChecked());
|
||||||
settings.setValue("closeAppWithCtrlQ", ui->closeAppWithCtrlQ->isChecked());
|
settings.setValue(QSL("closeAppWithCtrlQ"), ui->closeAppWithCtrlQ->isChecked());
|
||||||
settings.setValue("UseNativeScrollbars", ui->useNativeScrollbars->isChecked());
|
settings.setValue(QSL("UseNativeScrollbars"), ui->useNativeScrollbars->isChecked());
|
||||||
settings.setValue("DisableVideoAutoPlay", ui->disableVideoAutoPlay->isChecked());
|
settings.setValue(QSL("DisableVideoAutoPlay"), ui->disableVideoAutoPlay->isChecked());
|
||||||
settings.setValue("WebRTCPublicIpOnly", ui->webRTCPublicIpOnly->isChecked());
|
settings.setValue(QSL("WebRTCPublicIpOnly"), ui->webRTCPublicIpOnly->isChecked());
|
||||||
settings.setValue("DNSPrefetch", ui->dnsPrefetch->isChecked());
|
settings.setValue(QSL("DNSPrefetch"), ui->dnsPrefetch->isChecked());
|
||||||
settings.setValue("intPDFViewer", ui->intPDFViewer->isChecked());
|
settings.setValue(QSL("intPDFViewer"), ui->intPDFViewer->isChecked());
|
||||||
settings.setValue("screenCaptureEnabled", ui->screenCaptureEnabled->isChecked());
|
settings.setValue(QSL("screenCaptureEnabled"), ui->screenCaptureEnabled->isChecked());
|
||||||
settings.setValue("hardwareAccel", ui->hardwareAccel->isChecked());
|
settings.setValue(QSL("hardwareAccel"), ui->hardwareAccel->isChecked());
|
||||||
#ifdef Q_OS_WIN
|
#ifdef Q_OS_WIN
|
||||||
settings.setValue("CheckDefaultBrowser", ui->checkDefaultBrowser->isChecked());
|
settings.setValue(QSL("CheckDefaultBrowser"), ui->checkDefaultBrowser->isChecked());
|
||||||
#endif
|
#endif
|
||||||
//Cache
|
//Cache
|
||||||
settings.setValue("AllowLocalCache", ui->allowCache->isChecked());
|
settings.setValue(QSL("AllowLocalCache"), ui->allowCache->isChecked());
|
||||||
settings.setValue("deleteCacheOnClose", ui->removeCache->isChecked());
|
settings.setValue(QSL("deleteCacheOnClose"), ui->removeCache->isChecked());
|
||||||
settings.setValue("LocalCacheSize", ui->cacheMB->value());
|
settings.setValue(QSL("LocalCacheSize"), ui->cacheMB->value());
|
||||||
settings.setValue("CachePath", ui->cachePath->text());
|
settings.setValue(QSL("CachePath"), ui->cachePath->text());
|
||||||
//CSS Style
|
//CSS Style
|
||||||
settings.setValue("userStyleSheet", ui->userStyleSheet->text());
|
settings.setValue(QSL("userStyleSheet"), ui->userStyleSheet->text());
|
||||||
|
|
||||||
//PASSWORD MANAGER
|
//PASSWORD MANAGER
|
||||||
settings.setValue("SavePasswordsOnSites", ui->allowPassManager->isChecked());
|
settings.setValue(QSL("SavePasswordsOnSites"), ui->allowPassManager->isChecked());
|
||||||
settings.setValue("AutoCompletePasswords", ui->autoCompletePasswords->isChecked());
|
settings.setValue(QSL("AutoCompletePasswords"), ui->autoCompletePasswords->isChecked());
|
||||||
|
|
||||||
//PRIVACY
|
//PRIVACY
|
||||||
//Web storage
|
//Web storage
|
||||||
settings.setValue("allowHistory", ui->saveHistory->isChecked());
|
settings.setValue(QSL("allowHistory"), ui->saveHistory->isChecked());
|
||||||
settings.setValue("deleteHistoryOnClose", ui->deleteHistoryOnClose->isChecked());
|
settings.setValue(QSL("deleteHistoryOnClose"), ui->deleteHistoryOnClose->isChecked());
|
||||||
settings.setValue("HTML5StorageEnabled", ui->html5storage->isChecked());
|
settings.setValue(QSL("HTML5StorageEnabled"), ui->html5storage->isChecked());
|
||||||
settings.setValue("deleteHTML5StorageOnClose", ui->deleteHtml5storageOnClose->isChecked());
|
settings.setValue(QSL("deleteHTML5StorageOnClose"), ui->deleteHtml5storageOnClose->isChecked());
|
||||||
settings.endGroup();
|
settings.endGroup();
|
||||||
|
|
||||||
//NOTIFICATIONS
|
//NOTIFICATIONS
|
||||||
settings.beginGroup("Notifications");
|
settings.beginGroup(QSL("Notifications"));
|
||||||
settings.setValue("Timeout", ui->notificationTimeout->value() * 1000);
|
settings.setValue(QSL("Timeout"), ui->notificationTimeout->value() * 1000);
|
||||||
settings.setValue("Enabled", !ui->doNotUseNotifications->isChecked());
|
settings.setValue(QSL("Enabled"), !ui->doNotUseNotifications->isChecked());
|
||||||
settings.setValue("UseNativeDesktop", ui->useNativeSystemNotifications->isChecked());
|
settings.setValue(QSL("UseNativeDesktop"), ui->useNativeSystemNotifications->isChecked());
|
||||||
settings.setValue("Position", m_notification.data() ? m_notification.data()->pos() : m_notifPosition);
|
settings.setValue(QSL("Position"), m_notification.data() ? m_notification.data()->pos() : m_notifPosition);
|
||||||
settings.endGroup();
|
settings.endGroup();
|
||||||
|
|
||||||
//SPELLCHECK
|
//SPELLCHECK
|
||||||
settings.beginGroup(QSL("SpellCheck"));
|
settings.beginGroup(QSL("SpellCheck"));
|
||||||
settings.setValue("Enabled", ui->spellcheckEnabled->isChecked());
|
settings.setValue(QSL("Enabled"), ui->spellcheckEnabled->isChecked());
|
||||||
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);
|
||||||
@ -1027,30 +1027,30 @@ void Preferences::saveSettings()
|
|||||||
languages.append(item->data(Qt::UserRole).toString());
|
languages.append(item->data(Qt::UserRole).toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
settings.setValue("Languages", languages);
|
settings.setValue(QSL("Languages"), languages);
|
||||||
settings.endGroup();
|
settings.endGroup();
|
||||||
|
|
||||||
//OTHER
|
//OTHER
|
||||||
//AddressBar
|
//AddressBar
|
||||||
settings.beginGroup("AddressBar");
|
settings.beginGroup(QSL("AddressBar"));
|
||||||
settings.setValue("showSuggestions", ui->addressbarCompletion->currentIndex());
|
settings.setValue(QSL("showSuggestions"), ui->addressbarCompletion->currentIndex());
|
||||||
settings.setValue("useInlineCompletion", ui->useInlineCompletion->isChecked());
|
settings.setValue(QSL("useInlineCompletion"), ui->useInlineCompletion->isChecked());
|
||||||
settings.setValue("alwaysShowGoIcon", ui->alwaysShowGoIcon->isChecked());
|
settings.setValue(QSL("alwaysShowGoIcon"), ui->alwaysShowGoIcon->isChecked());
|
||||||
settings.setValue("showZoomLabel", ui->showZoomLabel->isChecked());
|
settings.setValue(QSL("showZoomLabel"), ui->showZoomLabel->isChecked());
|
||||||
settings.setValue("showSwitchTab", ui->completionShowSwitchTab->isChecked());
|
settings.setValue(QSL("showSwitchTab"), ui->completionShowSwitchTab->isChecked());
|
||||||
settings.setValue("SelectAllTextOnDoubleClick", ui->selectAllOnFocus->isChecked());
|
settings.setValue(QSL("SelectAllTextOnDoubleClick"), ui->selectAllOnFocus->isChecked());
|
||||||
settings.setValue("SelectAllTextOnClick", ui->selectAllOnClick->isChecked());
|
settings.setValue(QSL("SelectAllTextOnClick"), ui->selectAllOnClick->isChecked());
|
||||||
settings.setValue("CompletionPopupExpandToWindow", ui->completionPopupExpandToWindow->isChecked());
|
settings.setValue(QSL("CompletionPopupExpandToWindow"), ui->completionPopupExpandToWindow->isChecked());
|
||||||
settings.setValue("ShowLoadingProgress", ui->showLoadingInAddressBar->isChecked());
|
settings.setValue(QSL("ShowLoadingProgress"), ui->showLoadingInAddressBar->isChecked());
|
||||||
settings.setValue("ProgressStyle", ui->progressStyleSelector->currentIndex());
|
settings.setValue(QSL("ProgressStyle"), ui->progressStyleSelector->currentIndex());
|
||||||
settings.setValue("UseCustomProgressColor", ui->checkBoxCustomProgressColor->isChecked());
|
settings.setValue(QSL("UseCustomProgressColor"), ui->checkBoxCustomProgressColor->isChecked());
|
||||||
settings.setValue("CustomProgressColor", ui->customColorToolButton->property("ProgressColor").value<QColor>());
|
settings.setValue(QSL("CustomProgressColor"), ui->customColorToolButton->property("ProgressColor").value<QColor>());
|
||||||
settings.endGroup();
|
settings.endGroup();
|
||||||
|
|
||||||
settings.beginGroup("SearchEngines");
|
settings.beginGroup(QSL("SearchEngines"));
|
||||||
settings.setValue("SearchFromAddressBar", ui->searchFromAddressBar->isChecked());
|
settings.setValue(QSL("SearchFromAddressBar"), ui->searchFromAddressBar->isChecked());
|
||||||
settings.setValue("SearchWithDefaultEngine", ui->searchWithDefaultEngine->isChecked());
|
settings.setValue(QSL("SearchWithDefaultEngine"), ui->searchWithDefaultEngine->isChecked());
|
||||||
settings.setValue("showSearchSuggestions", ui->showABSearchSuggestions->isChecked());
|
settings.setValue(QSL("showSearchSuggestions"), ui->showABSearchSuggestions->isChecked());
|
||||||
settings.endGroup();
|
settings.endGroup();
|
||||||
|
|
||||||
//Proxy Configuration
|
//Proxy Configuration
|
||||||
@ -1065,12 +1065,12 @@ void Preferences::saveSettings()
|
|||||||
proxyType = 4;
|
proxyType = 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
settings.beginGroup("Web-Proxy");
|
settings.beginGroup(QSL("Web-Proxy"));
|
||||||
settings.setValue("ProxyType", proxyType);
|
settings.setValue(QSL("ProxyType"), proxyType);
|
||||||
settings.setValue("HostName", ui->proxyServer->text());
|
settings.setValue(QSL("HostName"), ui->proxyServer->text());
|
||||||
settings.setValue("Port", ui->proxyPort->text().toInt());
|
settings.setValue(QSL("Port"), ui->proxyPort->text().toInt());
|
||||||
settings.setValue("Username", ui->proxyUsername->text());
|
settings.setValue(QSL("Username"), ui->proxyUsername->text());
|
||||||
settings.setValue("Password", ui->proxyPassword->text());
|
settings.setValue(QSL("Password"), ui->proxyPassword->text());
|
||||||
settings.endGroup();
|
settings.endGroup();
|
||||||
|
|
||||||
ProfileManager::setStartingProfile(ui->startProfile->currentText());
|
ProfileManager::setStartingProfile(ui->startProfile->currentText());
|
||||||
|
@ -40,8 +40,8 @@ ThemeManager::ThemeManager(QWidget* parent, Preferences* preferences)
|
|||||||
ui->remove->setIcon(QIcon::fromTheme(QSL("edit-delete")));
|
ui->remove->setIcon(QIcon::fromTheme(QSL("edit-delete")));
|
||||||
|
|
||||||
Settings settings;
|
Settings settings;
|
||||||
settings.beginGroup("Themes");
|
settings.beginGroup(QSL("Themes"));
|
||||||
m_activeTheme = settings.value("activeTheme", DEFAULT_THEME_NAME).toString();
|
m_activeTheme = settings.value(QSL("activeTheme"), DEFAULT_THEME_NAME).toString();
|
||||||
settings.endGroup();
|
settings.endGroup();
|
||||||
|
|
||||||
const QStringList themePaths = DataPaths::allPaths(DataPaths::Themes);
|
const QStringList themePaths = DataPaths::allPaths(DataPaths::Themes);
|
||||||
@ -129,7 +129,7 @@ ThemeManager::Theme ThemeManager::parseTheme(const QString &path, const QString
|
|||||||
Theme info;
|
Theme info;
|
||||||
info.isValid = false;
|
info.isValid = false;
|
||||||
|
|
||||||
if (!QFile(path + QStringLiteral("main.css")).exists() || !QFile(path + "metadata.desktop").exists()) {
|
if (!QFile(path + QStringLiteral("main.css")).exists() || !QFile(path + QSL("metadata.desktop")).exists()) {
|
||||||
info.isValid = false;
|
info.isValid = false;
|
||||||
return info;
|
return info;
|
||||||
}
|
}
|
||||||
@ -171,8 +171,8 @@ void ThemeManager::save()
|
|||||||
}
|
}
|
||||||
|
|
||||||
Settings settings;
|
Settings settings;
|
||||||
settings.beginGroup("Themes");
|
settings.beginGroup(QSL("Themes"));
|
||||||
settings.setValue("activeTheme", currentItem->data(Qt::UserRole));
|
settings.setValue(QSL("activeTheme"), currentItem->data(Qt::UserRole));
|
||||||
settings.endGroup();
|
settings.endGroup();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -49,10 +49,10 @@ UserAgentDialog::UserAgentDialog(QWidget* parent)
|
|||||||
QRegularExpression chromeRx(QSL("Chrome/([^\\s]+)"));
|
QRegularExpression chromeRx(QSL("Chrome/([^\\s]+)"));
|
||||||
const QString chromeVersion = chromeRx.match(m_manager->defaultUserAgent()).captured(1);
|
const QString chromeVersion = chromeRx.match(m_manager->defaultUserAgent()).captured(1);
|
||||||
|
|
||||||
m_knownUserAgents << QString("Opera/9.80 (%1) Presto/2.12.388 Version/12.16").arg(os)
|
m_knownUserAgents << QSL("Opera/9.80 (%1) Presto/2.12.388 Version/12.16").arg(os)
|
||||||
<< QString("Mozilla/5.0 (%1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/%2 Safari/537.36").arg(os, chromeVersion)
|
<< QSL("Mozilla/5.0 (%1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/%2 Safari/537.36").arg(os, chromeVersion)
|
||||||
<< QString("Mozilla/5.0 (%1) AppleWebKit/602.3.12 (KHTML, like Gecko) Version/10.0.2 Safari/602.3.12").arg(os)
|
<< QSL("Mozilla/5.0 (%1) AppleWebKit/602.3.12 (KHTML, like Gecko) Version/10.0.2 Safari/602.3.12").arg(os)
|
||||||
<< QString("Mozilla/5.0 (%1; rv:102.0) Gecko/20100101 Firefox/102.0").arg(os);
|
<< QSL("Mozilla/5.0 (%1; rv:102.0) Gecko/20100101 Firefox/102.0").arg(os);
|
||||||
|
|
||||||
ui->globalComboBox->addItems(m_knownUserAgents);
|
ui->globalComboBox->addItems(m_knownUserAgents);
|
||||||
|
|
||||||
@ -167,14 +167,14 @@ void UserAgentDialog::accept()
|
|||||||
}
|
}
|
||||||
|
|
||||||
Settings settings;
|
Settings settings;
|
||||||
settings.beginGroup("Web-Browser-Settings");
|
settings.beginGroup(QSL("Web-Browser-Settings"));
|
||||||
settings.setValue("UserAgent", globalUserAgent);
|
settings.setValue(QSL("UserAgent"), globalUserAgent);
|
||||||
settings.endGroup();
|
settings.endGroup();
|
||||||
|
|
||||||
settings.beginGroup("User-Agent-Settings");
|
settings.beginGroup(QSL("User-Agent-Settings"));
|
||||||
settings.setValue("UsePerDomainUA", ui->changePerSite->isChecked());
|
settings.setValue(QSL("UsePerDomainUA"), ui->changePerSite->isChecked());
|
||||||
settings.setValue("DomainList", domainList);
|
settings.setValue(QSL("DomainList"), domainList);
|
||||||
settings.setValue("UserAgentsList", userAgentsList);
|
settings.setValue(QSL("UserAgentsList"), userAgentsList);
|
||||||
settings.endGroup();
|
settings.endGroup();
|
||||||
|
|
||||||
m_manager->loadSettings();
|
m_manager->loadSettings();
|
||||||
|
@ -132,7 +132,7 @@ void SessionManager::renameSession(QString sessionFilePath, SessionManager::Sess
|
|||||||
if (!ok)
|
if (!ok)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
const QString newSessionPath = QString("%1/%2.dat").arg(DataPaths::path(DataPaths::Sessions), newName);
|
const QString newSessionPath = QSL("%1/%2.dat").arg(DataPaths::path(DataPaths::Sessions), newName);
|
||||||
if (QFile::exists(newSessionPath)) {
|
if (QFile::exists(newSessionPath)) {
|
||||||
QMessageBox::information(mApp->activeWindow(), tr("Error!"), tr("The session file \"%1\" exists. Please enter another name.").arg(newName));
|
QMessageBox::information(mApp->activeWindow(), tr("Error!"), tr("The session file \"%1\" exists. Please enter another name.").arg(newName));
|
||||||
renameSession(sessionFilePath, flags);
|
renameSession(sessionFilePath, flags);
|
||||||
@ -161,12 +161,12 @@ void SessionManager::saveSession()
|
|||||||
bool ok;
|
bool ok;
|
||||||
QString sessionName = QInputDialog::getText(mApp->activeWindow(), tr("Save Session"),
|
QString sessionName = QInputDialog::getText(mApp->activeWindow(), tr("Save Session"),
|
||||||
tr("Please enter a name to save session:"), QLineEdit::Normal,
|
tr("Please enter a name to save session:"), QLineEdit::Normal,
|
||||||
tr("Saved Session (%1)").arg(QDateTime::currentDateTime().toString("dd MMM yyyy HH-mm-ss")), &ok);
|
tr("Saved Session (%1)").arg(QDateTime::currentDateTime().toString(QSL("dd MMM yyyy HH-mm-ss"))), &ok);
|
||||||
|
|
||||||
if (!ok)
|
if (!ok)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
const QString filePath = QString("%1/%2.dat").arg(DataPaths::path(DataPaths::Sessions), sessionName);
|
const QString filePath = QSL("%1/%2.dat").arg(DataPaths::path(DataPaths::Sessions), sessionName);
|
||||||
if (QFile::exists(filePath)) {
|
if (QFile::exists(filePath)) {
|
||||||
QMessageBox::information(mApp->activeWindow(), tr("Error!"), tr("The session file \"%1\" exists. Please enter another name.").arg(sessionName));
|
QMessageBox::information(mApp->activeWindow(), tr("Error!"), tr("The session file \"%1\" exists. Please enter another name.").arg(sessionName));
|
||||||
saveSession();
|
saveSession();
|
||||||
@ -209,7 +209,7 @@ void SessionManager::newSession()
|
|||||||
bool ok;
|
bool ok;
|
||||||
QString sessionName = QInputDialog::getText(mApp->activeWindow(), tr("New Session"),
|
QString sessionName = QInputDialog::getText(mApp->activeWindow(), tr("New Session"),
|
||||||
tr("Please enter a name to create new session:"), QLineEdit::Normal,
|
tr("Please enter a name to create new session:"), QLineEdit::Normal,
|
||||||
tr("New Session (%1)").arg(QDateTime::currentDateTime().toString("dd MMM yyyy HH-mm-ss")), &ok);
|
tr("New Session (%1)").arg(QDateTime::currentDateTime().toString(QSL("dd MMM yyyy HH-mm-ss"))), &ok);
|
||||||
|
|
||||||
if (!ok)
|
if (!ok)
|
||||||
return;
|
return;
|
||||||
@ -312,8 +312,8 @@ void SessionManager::loadSettings()
|
|||||||
QDir sessionsDir(DataPaths::path(DataPaths::Sessions));
|
QDir sessionsDir(DataPaths::path(DataPaths::Sessions));
|
||||||
|
|
||||||
Settings settings;
|
Settings settings;
|
||||||
settings.beginGroup("Web-Browser-Settings");
|
settings.beginGroup(QSL("Web-Browser-Settings"));
|
||||||
m_lastActiveSessionPath = settings.value("lastActiveSessionPath", defaultSessionPath()).toString();
|
m_lastActiveSessionPath = settings.value(QSL("lastActiveSessionPath"), defaultSessionPath()).toString();
|
||||||
settings.endGroup();
|
settings.endGroup();
|
||||||
|
|
||||||
if (QDir::isRelativePath(m_lastActiveSessionPath)) {
|
if (QDir::isRelativePath(m_lastActiveSessionPath)) {
|
||||||
@ -330,8 +330,8 @@ void SessionManager::saveSettings()
|
|||||||
QDir sessionsDir(DataPaths::path(DataPaths::Sessions));
|
QDir sessionsDir(DataPaths::path(DataPaths::Sessions));
|
||||||
|
|
||||||
Settings settings;
|
Settings settings;
|
||||||
settings.beginGroup("Web-Browser-Settings");
|
settings.beginGroup(QSL("Web-Browser-Settings"));
|
||||||
settings.setValue("lastActiveSessionPath", sessionsDir.relativeFilePath(m_lastActiveSessionPath));
|
settings.setValue(QSL("lastActiveSessionPath"), sessionsDir.relativeFilePath(m_lastActiveSessionPath));
|
||||||
settings.endGroup();
|
settings.endGroup();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -105,7 +105,7 @@ void BookmarksSidebar::createContextMenu(const QPoint &pos)
|
|||||||
QAction* actNewPrivateWindow = menu.addAction(IconProvider::privateBrowsingIcon(), tr("Open in new private window"));
|
QAction* actNewPrivateWindow = menu.addAction(IconProvider::privateBrowsingIcon(), tr("Open in new private window"));
|
||||||
|
|
||||||
menu.addSeparator();
|
menu.addSeparator();
|
||||||
QAction* actDelete = menu.addAction(QIcon::fromTheme("edit-delete"), tr("Delete"));
|
QAction* actDelete = menu.addAction(QIcon::fromTheme(QSL("edit-delete")), tr("Delete"));
|
||||||
|
|
||||||
connect(actNewTab, SIGNAL(triggered()), this, SLOT(openBookmarkInNewTab()));
|
connect(actNewTab, SIGNAL(triggered()), this, SLOT(openBookmarkInNewTab()));
|
||||||
connect(actNewWindow, SIGNAL(triggered()), this, SLOT(openBookmarkInNewWindow()));
|
connect(actNewWindow, SIGNAL(triggered()), this, SLOT(openBookmarkInNewWindow()));
|
||||||
|
@ -107,15 +107,15 @@ void SideBarManager::createMenu(QMenu* menu)
|
|||||||
|
|
||||||
QAction* act = menu->addAction(SideBar::tr("Bookmarks"), this, &SideBarManager::slotShowSideBar);
|
QAction* act = menu->addAction(SideBar::tr("Bookmarks"), this, &SideBarManager::slotShowSideBar);
|
||||||
act->setCheckable(true);
|
act->setCheckable(true);
|
||||||
act->setShortcut(QKeySequence("Ctrl+Shift+B"));
|
act->setShortcut(QKeySequence(QSL("Ctrl+Shift+B")));
|
||||||
act->setData("Bookmarks");
|
act->setData(QSL("Bookmarks"));
|
||||||
act->setChecked(m_activeBar == QL1S("Bookmarks"));
|
act->setChecked(m_activeBar == QL1S("Bookmarks"));
|
||||||
group->addAction(act);
|
group->addAction(act);
|
||||||
|
|
||||||
act = menu->addAction(SideBar::tr("History"), this, &SideBarManager::slotShowSideBar);
|
act = menu->addAction(SideBar::tr("History"), this, &SideBarManager::slotShowSideBar);
|
||||||
act->setCheckable(true);
|
act->setCheckable(true);
|
||||||
act->setShortcut(QKeySequence("Ctrl+H"));
|
act->setShortcut(QKeySequence(QSL("Ctrl+H")));
|
||||||
act->setData("History");
|
act->setData(QSL("History"));
|
||||||
act->setChecked(m_activeBar == QL1S("History"));
|
act->setChecked(m_activeBar == QL1S("History"));
|
||||||
group->addAction(act);
|
group->addAction(act);
|
||||||
|
|
||||||
|
@ -94,7 +94,7 @@ TabBar::TabBar(BrowserWindow* window, TabWidget* tabWidget)
|
|||||||
, m_activeTabWidth(0)
|
, m_activeTabWidth(0)
|
||||||
, m_forceHidden(false)
|
, m_forceHidden(false)
|
||||||
{
|
{
|
||||||
setObjectName("tabbar");
|
setObjectName(QSL("tabbar"));
|
||||||
setElideMode(Qt::ElideRight);
|
setElideMode(Qt::ElideRight);
|
||||||
setFocusPolicy(Qt::NoFocus);
|
setFocusPolicy(Qt::NoFocus);
|
||||||
setTabsClosable(false);
|
setTabsClosable(false);
|
||||||
@ -126,10 +126,10 @@ TabBar::TabBar(BrowserWindow* window, TabWidget* tabWidget)
|
|||||||
void TabBar::loadSettings()
|
void TabBar::loadSettings()
|
||||||
{
|
{
|
||||||
Settings settings;
|
Settings settings;
|
||||||
settings.beginGroup("Browser-Tabs-Settings");
|
settings.beginGroup(QSL("Browser-Tabs-Settings"));
|
||||||
m_hideTabBarWithOneTab = settings.value("hideTabsWithOneTab", false).toBool();
|
m_hideTabBarWithOneTab = settings.value(QSL("hideTabsWithOneTab"), false).toBool();
|
||||||
bool activateLastTab = settings.value("ActivateLastTabWhenClosingActual", false).toBool();
|
bool activateLastTab = settings.value(QSL("ActivateLastTabWhenClosingActual"), false).toBool();
|
||||||
m_showCloseOnInactive = settings.value("showCloseOnInactiveTabs", 0).toInt(0);
|
m_showCloseOnInactive = settings.value(QSL("showCloseOnInactiveTabs"), 0).toInt(0);
|
||||||
settings.endGroup();
|
settings.endGroup();
|
||||||
|
|
||||||
setSelectionBehaviorOnRemove(activateLastTab ? QTabBar::SelectPreviousTab : QTabBar::SelectRightTab);
|
setSelectionBehaviorOnRemove(activateLastTab ? QTabBar::SelectPreviousTab : QTabBar::SelectRightTab);
|
||||||
|
@ -53,7 +53,7 @@ TabContextMenu::TabContextMenu(int index, BrowserWindow *window, Options options
|
|||||||
static bool canCloseTabs(const QString &settingsKey, const QString &title, const QString &description)
|
static bool canCloseTabs(const QString &settingsKey, const QString &title, const QString &description)
|
||||||
{
|
{
|
||||||
Settings settings;
|
Settings settings;
|
||||||
bool ask = settings.value("Browser-Tabs-Settings/" + settingsKey, true).toBool();
|
bool ask = settings.value(QSL("Browser-Tabs-Settings/") + settingsKey, true).toBool();
|
||||||
|
|
||||||
if (ask) {
|
if (ask) {
|
||||||
CheckBoxDialog dialog(QMessageBox::Yes | QMessageBox::No, mApp->activeWindow());
|
CheckBoxDialog dialog(QMessageBox::Yes | QMessageBox::No, mApp->activeWindow());
|
||||||
@ -68,7 +68,7 @@ static bool canCloseTabs(const QString &settingsKey, const QString &title, const
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (dialog.isChecked()) {
|
if (dialog.isChecked()) {
|
||||||
settings.setValue("Browser-Tabs-Settings/" + settingsKey, false);
|
settings.setValue(QSL("Browser-Tabs-Settings/") + settingsKey, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -120,10 +120,10 @@ void TabContextMenu::init()
|
|||||||
addAction(QIcon::fromTheme(QSL("view-refresh")), tr("&Reload Tab"), this, SLOT(reloadTab()));
|
addAction(QIcon::fromTheme(QSL("view-refresh")), tr("&Reload Tab"), this, SLOT(reloadTab()));
|
||||||
}
|
}
|
||||||
|
|
||||||
addAction(QIcon::fromTheme("tab-duplicate"), tr("&Duplicate Tab"), this, SLOT(duplicateTab()));
|
addAction(QIcon::fromTheme(QSL("tab-duplicate")), tr("&Duplicate Tab"), this, SLOT(duplicateTab()));
|
||||||
|
|
||||||
if (m_options & ShowDetachTabAction && (mApp->windowCount() > 1 || tabWidget->count() > 1)) {
|
if (m_options & ShowDetachTabAction && (mApp->windowCount() > 1 || tabWidget->count() > 1)) {
|
||||||
addAction(QIcon::fromTheme("tab-detach"), tr("D&etach Tab"), this, SLOT(detachTab()));
|
addAction(QIcon::fromTheme(QSL("tab-detach")), tr("D&etach Tab"), this, SLOT(detachTab()));
|
||||||
}
|
}
|
||||||
|
|
||||||
addAction(webTab->isPinned() ? tr("Un&pin Tab") : tr("&Pin Tab"), this, &TabContextMenu::pinTab);
|
addAction(webTab->isPinned() ? tr("Un&pin Tab") : tr("&Pin Tab"), this, &TabContextMenu::pinTab);
|
||||||
@ -148,7 +148,7 @@ void TabContextMenu::init()
|
|||||||
}
|
}
|
||||||
|
|
||||||
addAction(m_window->action(QSL("Other/RestoreClosedTab")));
|
addAction(m_window->action(QSL("Other/RestoreClosedTab")));
|
||||||
addAction(QIcon::fromTheme("window-close"), tr("Cl&ose Tab"), this, &TabContextMenu::closeTab);
|
addAction(QIcon::fromTheme(QSL("window-close")), tr("Cl&ose Tab"), this, &TabContextMenu::closeTab);
|
||||||
} else {
|
} else {
|
||||||
addAction(IconProvider::newTabIcon(), tr("&New tab"), m_window, &BrowserWindow::addTab);
|
addAction(IconProvider::newTabIcon(), tr("&New tab"), m_window, &BrowserWindow::addTab);
|
||||||
addSeparator();
|
addSeparator();
|
||||||
|
@ -157,15 +157,15 @@ BrowserWindow *TabWidget::browserWindow() const
|
|||||||
void TabWidget::loadSettings()
|
void TabWidget::loadSettings()
|
||||||
{
|
{
|
||||||
Settings settings;
|
Settings settings;
|
||||||
settings.beginGroup("Browser-Tabs-Settings");
|
settings.beginGroup(QSL("Browser-Tabs-Settings"));
|
||||||
m_dontCloseWithOneTab = settings.value("dontCloseWithOneTab", false).toBool();
|
m_dontCloseWithOneTab = settings.value(QSL("dontCloseWithOneTab"), false).toBool();
|
||||||
m_showClosedTabsButton = settings.value("showClosedTabsButton", false).toBool();
|
m_showClosedTabsButton = settings.value(QSL("showClosedTabsButton"), false).toBool();
|
||||||
m_newTabAfterActive = settings.value("newTabAfterActive", true).toBool();
|
m_newTabAfterActive = settings.value(QSL("newTabAfterActive"), true).toBool();
|
||||||
m_newEmptyTabAfterActive = settings.value("newEmptyTabAfterActive", false).toBool();
|
m_newEmptyTabAfterActive = settings.value(QSL("newEmptyTabAfterActive"), false).toBool();
|
||||||
settings.endGroup();
|
settings.endGroup();
|
||||||
|
|
||||||
settings.beginGroup("Web-URL-Settings");
|
settings.beginGroup(QSL("Web-URL-Settings"));
|
||||||
m_urlOnNewTab = settings.value("newTabUrl", "falkon:speeddial").toUrl();
|
m_urlOnNewTab = settings.value(QSL("newTabUrl"), QSL("falkon:speeddial")).toUrl();
|
||||||
settings.endGroup();
|
settings.endGroup();
|
||||||
|
|
||||||
m_tabBar->loadSettings();
|
m_tabBar->loadSettings();
|
||||||
|
@ -323,15 +323,15 @@ CertificateInfoWidget::CertificateInfoWidget(const QSslCertificate &cert, QWidge
|
|||||||
ui->issuedToCN->setText(showCertInfo(cert.subjectInfo(QSslCertificate::CommonName)));
|
ui->issuedToCN->setText(showCertInfo(cert.subjectInfo(QSslCertificate::CommonName)));
|
||||||
ui->issuedToO->setText(showCertInfo(cert.subjectInfo(QSslCertificate::Organization)));
|
ui->issuedToO->setText(showCertInfo(cert.subjectInfo(QSslCertificate::Organization)));
|
||||||
ui->issuedToOU->setText(showCertInfo(cert.subjectInfo(QSslCertificate::OrganizationalUnitName)));
|
ui->issuedToOU->setText(showCertInfo(cert.subjectInfo(QSslCertificate::OrganizationalUnitName)));
|
||||||
ui->issuedToSN->setText(showCertInfo(cert.serialNumber()));
|
ui->issuedToSN->setText(showCertInfo(QString::fromLatin1(cert.serialNumber())));
|
||||||
//Issued By
|
//Issued By
|
||||||
ui->issuedByCN->setText(showCertInfo(cert.issuerInfo(QSslCertificate::CommonName)));
|
ui->issuedByCN->setText(showCertInfo(cert.issuerInfo(QSslCertificate::CommonName)));
|
||||||
ui->issuedByO->setText(showCertInfo(cert.issuerInfo(QSslCertificate::Organization)));
|
ui->issuedByO->setText(showCertInfo(cert.issuerInfo(QSslCertificate::Organization)));
|
||||||
ui->issuedByOU->setText(showCertInfo(cert.issuerInfo(QSslCertificate::OrganizationalUnitName)));
|
ui->issuedByOU->setText(showCertInfo(cert.issuerInfo(QSslCertificate::OrganizationalUnitName)));
|
||||||
//Validity
|
//Validity
|
||||||
QLocale locale = QLocale::system();
|
QLocale locale = QLocale::system();
|
||||||
ui->validityIssuedOn->setText(locale.toString(cert.effectiveDate(), "dddd d. MMMM yyyy"));
|
ui->validityIssuedOn->setText(locale.toString(cert.effectiveDate(), QSL("dddd d. MMMM yyyy")));
|
||||||
ui->validityExpiresOn->setText(locale.toString(cert.expiryDate(), "dddd d. MMMM yyyy"));
|
ui->validityExpiresOn->setText(locale.toString(cert.expiryDate(), QSL("dddd d. MMMM yyyy")));
|
||||||
}
|
}
|
||||||
|
|
||||||
CertificateInfoWidget::~CertificateInfoWidget()
|
CertificateInfoWidget::~CertificateInfoWidget()
|
||||||
|
@ -126,31 +126,31 @@ QWebEnginePage::Feature HTML5PermissionsDialog::currentFeature() const
|
|||||||
void HTML5PermissionsDialog::loadSettings()
|
void HTML5PermissionsDialog::loadSettings()
|
||||||
{
|
{
|
||||||
Settings settings;
|
Settings settings;
|
||||||
settings.beginGroup("HTML5Notifications");
|
settings.beginGroup(QSL("HTML5Notifications"));
|
||||||
|
|
||||||
m_granted[QWebEnginePage::Notifications] = settings.value("NotificationsGranted", QStringList()).toStringList();
|
m_granted[QWebEnginePage::Notifications] = settings.value(QSL("NotificationsGranted"), QStringList()).toStringList();
|
||||||
m_denied[QWebEnginePage::Notifications] = settings.value("NotificationsDenied", QStringList()).toStringList();
|
m_denied[QWebEnginePage::Notifications] = settings.value(QSL("NotificationsDenied"), QStringList()).toStringList();
|
||||||
|
|
||||||
m_granted[QWebEnginePage::Geolocation] = settings.value("GeolocationGranted", QStringList()).toStringList();
|
m_granted[QWebEnginePage::Geolocation] = settings.value(QSL("GeolocationGranted"), QStringList()).toStringList();
|
||||||
m_denied[QWebEnginePage::Geolocation] = settings.value("GeolocationDenied", QStringList()).toStringList();
|
m_denied[QWebEnginePage::Geolocation] = settings.value(QSL("GeolocationDenied"), QStringList()).toStringList();
|
||||||
|
|
||||||
m_granted[QWebEnginePage::MediaAudioCapture] = settings.value("MediaAudioCaptureGranted", QStringList()).toStringList();
|
m_granted[QWebEnginePage::MediaAudioCapture] = settings.value(QSL("MediaAudioCaptureGranted"), QStringList()).toStringList();
|
||||||
m_denied[QWebEnginePage::MediaAudioCapture] = settings.value("MediaAudioCaptureDenied", QStringList()).toStringList();
|
m_denied[QWebEnginePage::MediaAudioCapture] = settings.value(QSL("MediaAudioCaptureDenied"), QStringList()).toStringList();
|
||||||
|
|
||||||
m_granted[QWebEnginePage::MediaVideoCapture] = settings.value("MediaVideoCaptureGranted", QStringList()).toStringList();
|
m_granted[QWebEnginePage::MediaVideoCapture] = settings.value(QSL("MediaVideoCaptureGranted"), QStringList()).toStringList();
|
||||||
m_denied[QWebEnginePage::MediaVideoCapture] = settings.value("MediaVideoCaptureDenied", QStringList()).toStringList();
|
m_denied[QWebEnginePage::MediaVideoCapture] = settings.value(QSL("MediaVideoCaptureDenied"), QStringList()).toStringList();
|
||||||
|
|
||||||
m_granted[QWebEnginePage::MediaAudioVideoCapture] = settings.value("MediaAudioVideoCaptureGranted", QStringList()).toStringList();
|
m_granted[QWebEnginePage::MediaAudioVideoCapture] = settings.value(QSL("MediaAudioVideoCaptureGranted"), QStringList()).toStringList();
|
||||||
m_denied[QWebEnginePage::MediaAudioVideoCapture] = settings.value("MediaAudioVideoCaptureDenied", QStringList()).toStringList();
|
m_denied[QWebEnginePage::MediaAudioVideoCapture] = settings.value(QSL("MediaAudioVideoCaptureDenied"), QStringList()).toStringList();
|
||||||
|
|
||||||
m_granted[QWebEnginePage::MouseLock] = settings.value("MouseLockGranted", QStringList()).toStringList();
|
m_granted[QWebEnginePage::MouseLock] = settings.value(QSL("MouseLockGranted"), QStringList()).toStringList();
|
||||||
m_denied[QWebEnginePage::MouseLock] = settings.value("MouseLockDenied", QStringList()).toStringList();
|
m_denied[QWebEnginePage::MouseLock] = settings.value(QSL("MouseLockDenied"), QStringList()).toStringList();
|
||||||
|
|
||||||
m_granted[QWebEnginePage::DesktopVideoCapture] = settings.value("DesktopVideoCaptureGranted", QStringList()).toStringList();
|
m_granted[QWebEnginePage::DesktopVideoCapture] = settings.value(QSL("DesktopVideoCaptureGranted"), QStringList()).toStringList();
|
||||||
m_denied[QWebEnginePage::DesktopVideoCapture] = settings.value("DesktopVideoCaptureDenied", QStringList()).toStringList();
|
m_denied[QWebEnginePage::DesktopVideoCapture] = settings.value(QSL("DesktopVideoCaptureDenied"), QStringList()).toStringList();
|
||||||
|
|
||||||
m_granted[QWebEnginePage::DesktopAudioVideoCapture] = settings.value("DesktopAudioVideoCaptureGranted", QStringList()).toStringList();
|
m_granted[QWebEnginePage::DesktopAudioVideoCapture] = settings.value(QSL("DesktopAudioVideoCaptureGranted"), QStringList()).toStringList();
|
||||||
m_denied[QWebEnginePage::DesktopAudioVideoCapture] = settings.value("DesktopAudioVideoCaptureDenied", QStringList()).toStringList();
|
m_denied[QWebEnginePage::DesktopAudioVideoCapture] = settings.value(QSL("DesktopAudioVideoCaptureDenied"), QStringList()).toStringList();
|
||||||
|
|
||||||
settings.endGroup();
|
settings.endGroup();
|
||||||
}
|
}
|
||||||
@ -158,31 +158,31 @@ void HTML5PermissionsDialog::loadSettings()
|
|||||||
void HTML5PermissionsDialog::saveSettings()
|
void HTML5PermissionsDialog::saveSettings()
|
||||||
{
|
{
|
||||||
Settings settings;
|
Settings settings;
|
||||||
settings.beginGroup("HTML5Notifications");
|
settings.beginGroup(QSL("HTML5Notifications"));
|
||||||
|
|
||||||
settings.setValue("NotificationsGranted", m_granted[QWebEnginePage::Notifications]);
|
settings.setValue(QSL("NotificationsGranted"), m_granted[QWebEnginePage::Notifications]);
|
||||||
settings.setValue("NotificationsDenied", m_denied[QWebEnginePage::Notifications]);
|
settings.setValue(QSL("NotificationsDenied"), m_denied[QWebEnginePage::Notifications]);
|
||||||
|
|
||||||
settings.setValue("GeolocationGranted", m_granted[QWebEnginePage::Geolocation]);
|
settings.setValue(QSL("GeolocationGranted"), m_granted[QWebEnginePage::Geolocation]);
|
||||||
settings.setValue("GeolocationDenied", m_denied[QWebEnginePage::Geolocation]);
|
settings.setValue(QSL("GeolocationDenied"), m_denied[QWebEnginePage::Geolocation]);
|
||||||
|
|
||||||
settings.setValue("MediaAudioCaptureGranted", m_granted[QWebEnginePage::MediaAudioCapture]);
|
settings.setValue(QSL("MediaAudioCaptureGranted"), m_granted[QWebEnginePage::MediaAudioCapture]);
|
||||||
settings.setValue("MediaAudioCaptureDenied", m_denied[QWebEnginePage::MediaAudioCapture]);
|
settings.setValue(QSL("MediaAudioCaptureDenied"), m_denied[QWebEnginePage::MediaAudioCapture]);
|
||||||
|
|
||||||
settings.setValue("MediaVideoCaptureGranted", m_granted[QWebEnginePage::MediaVideoCapture]);
|
settings.setValue(QSL("MediaVideoCaptureGranted"), m_granted[QWebEnginePage::MediaVideoCapture]);
|
||||||
settings.setValue("MediaVideoCaptureDenied", m_denied[QWebEnginePage::MediaVideoCapture]);
|
settings.setValue(QSL("MediaVideoCaptureDenied"), m_denied[QWebEnginePage::MediaVideoCapture]);
|
||||||
|
|
||||||
settings.setValue("MediaAudioVideoCaptureGranted", m_granted[QWebEnginePage::MediaAudioVideoCapture]);
|
settings.setValue(QSL("MediaAudioVideoCaptureGranted"), m_granted[QWebEnginePage::MediaAudioVideoCapture]);
|
||||||
settings.setValue("MediaAudioVideoCaptureDenied", m_denied[QWebEnginePage::MediaAudioVideoCapture]);
|
settings.setValue(QSL("MediaAudioVideoCaptureDenied"), m_denied[QWebEnginePage::MediaAudioVideoCapture]);
|
||||||
|
|
||||||
settings.setValue("MouseLockGranted", m_granted[QWebEnginePage::MouseLock]);
|
settings.setValue(QSL("MouseLockGranted"), m_granted[QWebEnginePage::MouseLock]);
|
||||||
settings.setValue("MouseLockDenied", m_denied[QWebEnginePage::MouseLock]);
|
settings.setValue(QSL("MouseLockDenied"), m_denied[QWebEnginePage::MouseLock]);
|
||||||
|
|
||||||
settings.setValue("DesktopVideoCaptureGranted", m_granted[QWebEnginePage::DesktopVideoCapture]);
|
settings.setValue(QSL("DesktopVideoCaptureGranted"), m_granted[QWebEnginePage::DesktopVideoCapture]);
|
||||||
settings.setValue("DesktopVideoCaptureDenied", m_denied[QWebEnginePage::DesktopVideoCapture]);
|
settings.setValue(QSL("DesktopVideoCaptureDenied"), m_denied[QWebEnginePage::DesktopVideoCapture]);
|
||||||
|
|
||||||
settings.setValue("DesktopAudioVideoCaptureGranted", m_granted[QWebEnginePage::DesktopAudioVideoCapture]);
|
settings.setValue(QSL("DesktopAudioVideoCaptureGranted"), m_granted[QWebEnginePage::DesktopAudioVideoCapture]);
|
||||||
settings.setValue("DesktopAudioVideoCaptureDenied", m_denied[QWebEnginePage::DesktopAudioVideoCapture]);
|
settings.setValue(QSL("DesktopAudioVideoCaptureDenied"), m_denied[QWebEnginePage::DesktopAudioVideoCapture]);
|
||||||
|
|
||||||
settings.endGroup();
|
settings.endGroup();
|
||||||
|
|
||||||
|
@ -77,31 +77,31 @@ void HTML5PermissionsManager::rememberPermissions(const QUrl &origin, const QWeb
|
|||||||
void HTML5PermissionsManager::loadSettings()
|
void HTML5PermissionsManager::loadSettings()
|
||||||
{
|
{
|
||||||
Settings settings;
|
Settings settings;
|
||||||
settings.beginGroup("HTML5Notifications");
|
settings.beginGroup(QSL("HTML5Notifications"));
|
||||||
|
|
||||||
m_granted[QWebEnginePage::Notifications] = settings.value("NotificationsGranted", QStringList()).toStringList();
|
m_granted[QWebEnginePage::Notifications] = settings.value(QSL("NotificationsGranted"), QStringList()).toStringList();
|
||||||
m_denied[QWebEnginePage::Notifications] = settings.value("NotificationsDenied", QStringList()).toStringList();
|
m_denied[QWebEnginePage::Notifications] = settings.value(QSL("NotificationsDenied"), QStringList()).toStringList();
|
||||||
|
|
||||||
m_granted[QWebEnginePage::Geolocation] = settings.value("GeolocationGranted", QStringList()).toStringList();
|
m_granted[QWebEnginePage::Geolocation] = settings.value(QSL("GeolocationGranted"), QStringList()).toStringList();
|
||||||
m_denied[QWebEnginePage::Geolocation] = settings.value("GeolocationDenied", QStringList()).toStringList();
|
m_denied[QWebEnginePage::Geolocation] = settings.value(QSL("GeolocationDenied"), QStringList()).toStringList();
|
||||||
|
|
||||||
m_granted[QWebEnginePage::MediaAudioCapture] = settings.value("MediaAudioCaptureGranted", QStringList()).toStringList();
|
m_granted[QWebEnginePage::MediaAudioCapture] = settings.value(QSL("MediaAudioCaptureGranted"), QStringList()).toStringList();
|
||||||
m_denied[QWebEnginePage::MediaAudioCapture] = settings.value("MediaAudioCaptureDenied", QStringList()).toStringList();
|
m_denied[QWebEnginePage::MediaAudioCapture] = settings.value(QSL("MediaAudioCaptureDenied"), QStringList()).toStringList();
|
||||||
|
|
||||||
m_granted[QWebEnginePage::MediaVideoCapture] = settings.value("MediaVideoCaptureGranted", QStringList()).toStringList();
|
m_granted[QWebEnginePage::MediaVideoCapture] = settings.value(QSL("MediaVideoCaptureGranted"), QStringList()).toStringList();
|
||||||
m_denied[QWebEnginePage::MediaVideoCapture] = settings.value("MediaVideoCaptureDenied", QStringList()).toStringList();
|
m_denied[QWebEnginePage::MediaVideoCapture] = settings.value(QSL("MediaVideoCaptureDenied"), QStringList()).toStringList();
|
||||||
|
|
||||||
m_granted[QWebEnginePage::MediaAudioVideoCapture] = settings.value("MediaAudioVideoCaptureGranted", QStringList()).toStringList();
|
m_granted[QWebEnginePage::MediaAudioVideoCapture] = settings.value(QSL("MediaAudioVideoCaptureGranted"), QStringList()).toStringList();
|
||||||
m_denied[QWebEnginePage::MediaAudioVideoCapture] = settings.value("MediaAudioVideoCaptureDenied", QStringList()).toStringList();
|
m_denied[QWebEnginePage::MediaAudioVideoCapture] = settings.value(QSL("MediaAudioVideoCaptureDenied"), QStringList()).toStringList();
|
||||||
|
|
||||||
m_granted[QWebEnginePage::MouseLock] = settings.value("MouseLockGranted", QStringList()).toStringList();
|
m_granted[QWebEnginePage::MouseLock] = settings.value(QSL("MouseLockGranted"), QStringList()).toStringList();
|
||||||
m_denied[QWebEnginePage::MouseLock] = settings.value("MouseLockDenied", QStringList()).toStringList();
|
m_denied[QWebEnginePage::MouseLock] = settings.value(QSL("MouseLockDenied"), QStringList()).toStringList();
|
||||||
|
|
||||||
m_granted[QWebEnginePage::DesktopVideoCapture] = settings.value("DesktopVideoCaptureGranted", QStringList()).toStringList();
|
m_granted[QWebEnginePage::DesktopVideoCapture] = settings.value(QSL("DesktopVideoCaptureGranted"), QStringList()).toStringList();
|
||||||
m_denied[QWebEnginePage::DesktopVideoCapture] = settings.value("DesktopVideoCaptureDenied", QStringList()).toStringList();
|
m_denied[QWebEnginePage::DesktopVideoCapture] = settings.value(QSL("DesktopVideoCaptureDenied"), QStringList()).toStringList();
|
||||||
|
|
||||||
m_granted[QWebEnginePage::DesktopAudioVideoCapture] = settings.value("DesktopAudioVideoCaptureGranted", QStringList()).toStringList();
|
m_granted[QWebEnginePage::DesktopAudioVideoCapture] = settings.value(QSL("DesktopAudioVideoCaptureGranted"), QStringList()).toStringList();
|
||||||
m_denied[QWebEnginePage::DesktopAudioVideoCapture] = settings.value("DesktopAudioVideoCaptureDenied", QStringList()).toStringList();
|
m_denied[QWebEnginePage::DesktopAudioVideoCapture] = settings.value(QSL("DesktopAudioVideoCaptureDenied"), QStringList()).toStringList();
|
||||||
|
|
||||||
settings.endGroup();
|
settings.endGroup();
|
||||||
}
|
}
|
||||||
@ -109,31 +109,31 @@ void HTML5PermissionsManager::loadSettings()
|
|||||||
void HTML5PermissionsManager::saveSettings()
|
void HTML5PermissionsManager::saveSettings()
|
||||||
{
|
{
|
||||||
Settings settings;
|
Settings settings;
|
||||||
settings.beginGroup("HTML5Notifications");
|
settings.beginGroup(QSL("HTML5Notifications"));
|
||||||
|
|
||||||
settings.setValue("NotificationsGranted", m_granted[QWebEnginePage::Notifications]);
|
settings.setValue(QSL("NotificationsGranted"), m_granted[QWebEnginePage::Notifications]);
|
||||||
settings.setValue("NotificationsDenied", m_denied[QWebEnginePage::Notifications]);
|
settings.setValue(QSL("NotificationsDenied"), m_denied[QWebEnginePage::Notifications]);
|
||||||
|
|
||||||
settings.setValue("GeolocationGranted", m_granted[QWebEnginePage::Geolocation]);
|
settings.setValue(QSL("GeolocationGranted"), m_granted[QWebEnginePage::Geolocation]);
|
||||||
settings.setValue("GeolocationDenied", m_denied[QWebEnginePage::Geolocation]);
|
settings.setValue(QSL("GeolocationDenied"), m_denied[QWebEnginePage::Geolocation]);
|
||||||
|
|
||||||
settings.setValue("MediaAudioCaptureGranted", m_granted[QWebEnginePage::MediaAudioCapture]);
|
settings.setValue(QSL("MediaAudioCaptureGranted"), m_granted[QWebEnginePage::MediaAudioCapture]);
|
||||||
settings.setValue("MediaAudioCaptureDenied", m_denied[QWebEnginePage::MediaAudioCapture]);
|
settings.setValue(QSL("MediaAudioCaptureDenied"), m_denied[QWebEnginePage::MediaAudioCapture]);
|
||||||
|
|
||||||
settings.setValue("MediaVideoCaptureGranted", m_granted[QWebEnginePage::MediaVideoCapture]);
|
settings.setValue(QSL("MediaVideoCaptureGranted"), m_granted[QWebEnginePage::MediaVideoCapture]);
|
||||||
settings.setValue("MediaVideoCaptureDenied", m_denied[QWebEnginePage::MediaVideoCapture]);
|
settings.setValue(QSL("MediaVideoCaptureDenied"), m_denied[QWebEnginePage::MediaVideoCapture]);
|
||||||
|
|
||||||
settings.setValue("MediaAudioVideoCaptureGranted", m_granted[QWebEnginePage::MediaAudioVideoCapture]);
|
settings.setValue(QSL("MediaAudioVideoCaptureGranted"), m_granted[QWebEnginePage::MediaAudioVideoCapture]);
|
||||||
settings.setValue("MediaAudioVideoCaptureDenied", m_denied[QWebEnginePage::MediaAudioVideoCapture]);
|
settings.setValue(QSL("MediaAudioVideoCaptureDenied"), m_denied[QWebEnginePage::MediaAudioVideoCapture]);
|
||||||
|
|
||||||
settings.setValue("MouseLockGranted", m_granted[QWebEnginePage::MouseLock]);
|
settings.setValue(QSL("MouseLockGranted"), m_granted[QWebEnginePage::MouseLock]);
|
||||||
settings.setValue("MouseLockDenied", m_denied[QWebEnginePage::MouseLock]);
|
settings.setValue(QSL("MouseLockDenied"), m_denied[QWebEnginePage::MouseLock]);
|
||||||
|
|
||||||
settings.setValue("DesktopVideoCaptureGranted", m_granted[QWebEnginePage::DesktopVideoCapture]);
|
settings.setValue(QSL("DesktopVideoCaptureGranted"), m_granted[QWebEnginePage::DesktopVideoCapture]);
|
||||||
settings.setValue("DesktopVideoCaptureDenied", m_denied[QWebEnginePage::DesktopVideoCapture]);
|
settings.setValue(QSL("DesktopVideoCaptureDenied"), m_denied[QWebEnginePage::DesktopVideoCapture]);
|
||||||
|
|
||||||
settings.setValue("DesktopAudioVideoCaptureGranted", m_granted[QWebEnginePage::DesktopAudioVideoCapture]);
|
settings.setValue(QSL("DesktopAudioVideoCaptureGranted"), m_granted[QWebEnginePage::DesktopAudioVideoCapture]);
|
||||||
settings.setValue("DesktopAudioVideoCaptureDenied", m_denied[QWebEnginePage::DesktopAudioVideoCapture]);
|
settings.setValue(QSL("DesktopAudioVideoCaptureDenied"), m_denied[QWebEnginePage::DesktopAudioVideoCapture]);
|
||||||
|
|
||||||
settings.endGroup();
|
settings.endGroup();
|
||||||
}
|
}
|
||||||
|
@ -39,7 +39,7 @@ HTML5PermissionsNotification::HTML5PermissionsNotification(const QUrl &origin, Q
|
|||||||
|
|
||||||
ui->close->setIcon(IconProvider::standardIcon(QStyle::SP_DialogCloseButton));
|
ui->close->setIcon(IconProvider::standardIcon(QStyle::SP_DialogCloseButton));
|
||||||
|
|
||||||
const QString site = m_origin.host().isEmpty() ? tr("this site") : QString("<b>%1</b>").arg(m_origin.host());
|
const QString site = m_origin.host().isEmpty() ? tr("this site") : QSL("<b>%1</b>").arg(m_origin.host());
|
||||||
|
|
||||||
switch (feature) {
|
switch (feature) {
|
||||||
case QWebEnginePage::Notifications:
|
case QWebEnginePage::Notifications:
|
||||||
|
@ -204,7 +204,7 @@ QImage IconProvider::imageForUrl(const QUrl &url, bool allowNull)
|
|||||||
|
|
||||||
QSqlQuery query(SqlDatabase::instance()->database());
|
QSqlQuery query(SqlDatabase::instance()->database());
|
||||||
query.prepare(QSL("SELECT icon FROM icons WHERE url GLOB ? LIMIT 1"));
|
query.prepare(QSL("SELECT icon FROM icons WHERE url GLOB ? LIMIT 1"));
|
||||||
query.addBindValue(QString("%1*").arg(QzTools::escapeSqlGlobString(QString::fromUtf8(encodedUrl))));
|
query.addBindValue(QSL("%1*").arg(QzTools::escapeSqlGlobString(QString::fromUtf8(encodedUrl))));
|
||||||
query.exec();
|
query.exec();
|
||||||
|
|
||||||
auto *img = new QImage;
|
auto *img = new QImage;
|
||||||
@ -238,7 +238,7 @@ QImage IconProvider::imageForDomain(const QUrl &url, bool allowNull)
|
|||||||
|
|
||||||
QSqlQuery query(SqlDatabase::instance()->database());
|
QSqlQuery query(SqlDatabase::instance()->database());
|
||||||
query.prepare(QSL("SELECT icon FROM icons WHERE url GLOB ? LIMIT 1"));
|
query.prepare(QSL("SELECT icon FROM icons WHERE url GLOB ? LIMIT 1"));
|
||||||
query.addBindValue(QString("*%1*").arg(QzTools::escapeSqlGlobString(url.host())));
|
query.addBindValue(QSL("*%1*").arg(QzTools::escapeSqlGlobString(url.host())));
|
||||||
query.exec();
|
query.exec();
|
||||||
|
|
||||||
if (query.next()) {
|
if (query.next()) {
|
||||||
|
@ -81,7 +81,7 @@ QPixmap QzTools::pixmapFromByteArray(const QByteArray &data)
|
|||||||
|
|
||||||
QUrl QzTools::pixmapToDataUrl(const QPixmap &pix)
|
QUrl QzTools::pixmapToDataUrl(const QPixmap &pix)
|
||||||
{
|
{
|
||||||
const QString data(pixmapToByteArray(pix));
|
const QString data(QString::fromLatin1(pixmapToByteArray(pix)));
|
||||||
return data.isEmpty() ? QUrl() : QUrl(QSL("data:image/png;base64,") + data);
|
return data.isEmpty() ? QUrl() : QUrl(QSL("data:image/png;base64,") + data);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -325,8 +325,8 @@ QString QzTools::filterCharsFromFilename(const QString &name)
|
|||||||
QString QzTools::lastPathForFileDialog(const QString &dialogName, const QString &fallbackPath)
|
QString QzTools::lastPathForFileDialog(const QString &dialogName, const QString &fallbackPath)
|
||||||
{
|
{
|
||||||
Settings settings;
|
Settings settings;
|
||||||
settings.beginGroup("LastFileDialogsPaths");
|
settings.beginGroup(QSL("LastFileDialogsPaths"));
|
||||||
QString path = settings.value("FileDialogs/" + dialogName).toString();
|
QString path = settings.value(QSL("FileDialogs/") + dialogName).toString();
|
||||||
settings.endGroup();
|
settings.endGroup();
|
||||||
|
|
||||||
return path.isEmpty() ? fallbackPath : path;
|
return path.isEmpty() ? fallbackPath : path;
|
||||||
@ -339,7 +339,7 @@ void QzTools::saveLastPathForFileDialog(const QString &dialogName, const QString
|
|||||||
}
|
}
|
||||||
|
|
||||||
Settings settings;
|
Settings settings;
|
||||||
settings.beginGroup("LastFileDialogsPaths");
|
settings.beginGroup(QSL("LastFileDialogsPaths"));
|
||||||
settings.setValue(dialogName, path);
|
settings.setValue(dialogName, path);
|
||||||
settings.endGroup();
|
settings.endGroup();
|
||||||
}
|
}
|
||||||
@ -498,7 +498,7 @@ QIcon QzTools::iconFromFileName(const QString &fileName)
|
|||||||
}
|
}
|
||||||
|
|
||||||
QFileIconProvider iconProvider;
|
QFileIconProvider iconProvider;
|
||||||
QTemporaryFile tempFile(DataPaths::path(DataPaths::Temp) + "/XXXXXX." + tempInfo.suffix());
|
QTemporaryFile tempFile(DataPaths::path(DataPaths::Temp) + QSL("/XXXXXX.") + tempInfo.suffix());
|
||||||
tempFile.open();
|
tempFile.open();
|
||||||
tempInfo.setFile(tempFile.fileName());
|
tempInfo.setFile(tempFile.fileName());
|
||||||
|
|
||||||
@ -510,7 +510,7 @@ QIcon QzTools::iconFromFileName(const QString &fileName)
|
|||||||
|
|
||||||
QString QzTools::resolveFromPath(const QString &name)
|
QString QzTools::resolveFromPath(const QString &name)
|
||||||
{
|
{
|
||||||
const QString path = qgetenv("PATH").trimmed();
|
const QString path = QString::fromUtf8(qgetenv("PATH").trimmed());
|
||||||
|
|
||||||
if (path.isEmpty()) {
|
if (path.isEmpty()) {
|
||||||
return {};
|
return {};
|
||||||
@ -620,7 +620,7 @@ bool QzTools::containsSpace(const QString &str)
|
|||||||
QString QzTools::getExistingDirectory(const QString &name, QWidget* parent, const QString &caption, const QString &dir, QFileDialog::Options options)
|
QString QzTools::getExistingDirectory(const QString &name, QWidget* parent, const QString &caption, const QString &dir, QFileDialog::Options options)
|
||||||
{
|
{
|
||||||
Settings settings;
|
Settings settings;
|
||||||
settings.beginGroup("FileDialogPaths");
|
settings.beginGroup(QSL("FileDialogPaths"));
|
||||||
|
|
||||||
QString lastDir = settings.value(name, dir).toString();
|
QString lastDir = settings.value(name, dir).toString();
|
||||||
|
|
||||||
@ -656,7 +656,7 @@ static QString getFilename(const QString &path)
|
|||||||
QString QzTools::getOpenFileName(const QString &name, QWidget* parent, const QString &caption, const QString &dir, const QString &filter, QString* selectedFilter, QFileDialog::Options options)
|
QString QzTools::getOpenFileName(const QString &name, QWidget* parent, const QString &caption, const QString &dir, const QString &filter, QString* selectedFilter, QFileDialog::Options options)
|
||||||
{
|
{
|
||||||
Settings settings;
|
Settings settings;
|
||||||
settings.beginGroup("FileDialogPaths");
|
settings.beginGroup(QSL("FileDialogPaths"));
|
||||||
|
|
||||||
QString lastDir = settings.value(name, QString()).toString();
|
QString lastDir = settings.value(name, QString()).toString();
|
||||||
QString fileName = getFilename(dir);
|
QString fileName = getFilename(dir);
|
||||||
@ -681,7 +681,7 @@ QString QzTools::getOpenFileName(const QString &name, QWidget* parent, const QSt
|
|||||||
QStringList QzTools::getOpenFileNames(const QString &name, QWidget* parent, const QString &caption, const QString &dir, const QString &filter, QString* selectedFilter, QFileDialog::Options options)
|
QStringList QzTools::getOpenFileNames(const QString &name, QWidget* parent, const QString &caption, const QString &dir, const QString &filter, QString* selectedFilter, QFileDialog::Options options)
|
||||||
{
|
{
|
||||||
Settings settings;
|
Settings settings;
|
||||||
settings.beginGroup("FileDialogPaths");
|
settings.beginGroup(QSL("FileDialogPaths"));
|
||||||
|
|
||||||
QString lastDir = settings.value(name, QString()).toString();
|
QString lastDir = settings.value(name, QString()).toString();
|
||||||
QString fileName = getFilename(dir);
|
QString fileName = getFilename(dir);
|
||||||
@ -706,7 +706,7 @@ QStringList QzTools::getOpenFileNames(const QString &name, QWidget* parent, cons
|
|||||||
QString QzTools::getSaveFileName(const QString &name, QWidget* parent, const QString &caption, const QString &dir, const QString &filter, QString* selectedFilter, QFileDialog::Options options)
|
QString QzTools::getSaveFileName(const QString &name, QWidget* parent, const QString &caption, const QString &dir, const QString &filter, QString* selectedFilter, QFileDialog::Options options)
|
||||||
{
|
{
|
||||||
Settings settings;
|
Settings settings;
|
||||||
settings.beginGroup("FileDialogPaths");
|
settings.beginGroup(QSL("FileDialogPaths"));
|
||||||
|
|
||||||
QString lastDir = settings.value(name, QString()).toString();
|
QString lastDir = settings.value(name, QString()).toString();
|
||||||
QString fileName = getFilename(dir);
|
QString fileName = getFilename(dir);
|
||||||
@ -770,10 +770,10 @@ QStringList QzTools::splitCommandArguments(const QString &command)
|
|||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
QChar SPACE(' ');
|
QChar SPACE(QL1C(' '));
|
||||||
QChar EQUAL('=');
|
QChar EQUAL(QL1C('='));
|
||||||
QChar BSLASH('\\');
|
QChar BSLASH(QL1C('\\'));
|
||||||
QChar QUOTE('"');
|
QChar QUOTE(QL1C('"'));
|
||||||
QStringList r;
|
QStringList r;
|
||||||
|
|
||||||
int equalPos = -1; // Position of = in opt="value"
|
int equalPos = -1; // Position of = in opt="value"
|
||||||
@ -847,7 +847,7 @@ bool QzTools::startExternalProcess(const QString &executable, const QString &arg
|
|||||||
bool success = QProcess::startDetached(executable, arguments);
|
bool success = QProcess::startDetached(executable, arguments);
|
||||||
|
|
||||||
if (!success) {
|
if (!success) {
|
||||||
QString info = "<ul><li><b>%1</b>%2</li><li><b>%3</b>%4</li></ul>";
|
QString info = QSL("<ul><li><b>%1</b>%2</li><li><b>%3</b>%4</li></ul>");
|
||||||
info = info.arg(QObject::tr("Executable: "), executable,
|
info = info.arg(QObject::tr("Executable: "), executable,
|
||||||
QObject::tr("Arguments: "), arguments.join(QLatin1Char(' ')));
|
QObject::tr("Arguments: "), arguments.join(QLatin1Char(' ')));
|
||||||
|
|
||||||
@ -901,99 +901,99 @@ void QzTools::setWmClass(const QString &name, const QWidget* widget)
|
|||||||
QString QzTools::operatingSystem()
|
QString QzTools::operatingSystem()
|
||||||
{
|
{
|
||||||
#ifdef Q_OS_MACOS
|
#ifdef Q_OS_MACOS
|
||||||
QString str = "Mac OS X";
|
QString str = QSL("Mac OS X");
|
||||||
|
|
||||||
SInt32 majorVersion;
|
SInt32 majorVersion;
|
||||||
SInt32 minorVersion;
|
SInt32 minorVersion;
|
||||||
|
|
||||||
if (Gestalt(gestaltSystemVersionMajor, &majorVersion) == noErr && Gestalt(gestaltSystemVersionMinor, &minorVersion) == noErr) {
|
if (Gestalt(gestaltSystemVersionMajor, &majorVersion) == noErr && Gestalt(gestaltSystemVersionMinor, &minorVersion) == noErr) {
|
||||||
str.append(QString(" %1.%2").arg(majorVersion).arg(minorVersion));
|
str.append(QSL(" %1.%2").arg(majorVersion).arg(minorVersion));
|
||||||
}
|
}
|
||||||
|
|
||||||
return str;
|
return str;
|
||||||
#endif
|
#endif
|
||||||
#ifdef Q_OS_LINUX
|
#ifdef Q_OS_LINUX
|
||||||
return "Linux";
|
return QSL("Linux");
|
||||||
#endif
|
#endif
|
||||||
#ifdef Q_OS_BSD4
|
#ifdef Q_OS_BSD4
|
||||||
return "BSD 4.4";
|
return QSL("BSD 4.4");
|
||||||
#endif
|
#endif
|
||||||
#ifdef Q_OS_BSDI
|
#ifdef Q_OS_BSDI
|
||||||
return "BSD/OS";
|
return QSL("BSD/OS");
|
||||||
#endif
|
#endif
|
||||||
#ifdef Q_OS_FREEBSD
|
#ifdef Q_OS_FREEBSD
|
||||||
return "FreeBSD";
|
return QSL("FreeBSD");
|
||||||
#endif
|
#endif
|
||||||
#ifdef Q_OS_HPUX
|
#ifdef Q_OS_HPUX
|
||||||
return "HP-UX";
|
return QSL("HP-UX");
|
||||||
#endif
|
#endif
|
||||||
#ifdef Q_OS_HURD
|
#ifdef Q_OS_HURD
|
||||||
return "GNU Hurd";
|
return QSL("GNU Hurd");
|
||||||
#endif
|
#endif
|
||||||
#ifdef Q_OS_LYNX
|
#ifdef Q_OS_LYNX
|
||||||
return "LynxOS";
|
return QSL("LynxOS");
|
||||||
#endif
|
#endif
|
||||||
#ifdef Q_OS_NETBSD
|
#ifdef Q_OS_NETBSD
|
||||||
return "NetBSD";
|
return QSL("NetBSD");
|
||||||
#endif
|
#endif
|
||||||
#ifdef Q_OS_OS2
|
#ifdef Q_OS_OS2
|
||||||
return "OS/2";
|
return QSL("OS/2");
|
||||||
#endif
|
#endif
|
||||||
#ifdef Q_OS_OPENBSD
|
#ifdef Q_OS_OPENBSD
|
||||||
return "OpenBSD";
|
return QSL("OpenBSD");
|
||||||
#endif
|
#endif
|
||||||
#ifdef Q_OS_OSF
|
#ifdef Q_OS_OSF
|
||||||
return "HP Tru64 UNIX";
|
return QSL("HP Tru64 UNIX");
|
||||||
#endif
|
#endif
|
||||||
#ifdef Q_OS_SOLARIS
|
#ifdef Q_OS_SOLARIS
|
||||||
return "Sun Solaris";
|
return QSL("Sun Solaris");
|
||||||
#endif
|
#endif
|
||||||
#ifdef Q_OS_UNIXWARE
|
#ifdef Q_OS_UNIXWARE
|
||||||
return "UnixWare 7 / Open UNIX 8";
|
return QSL("UnixWare 7 / Open UNIX 8");
|
||||||
#endif
|
#endif
|
||||||
#ifdef Q_OS_UNIX
|
#ifdef Q_OS_UNIX
|
||||||
return "Unix";
|
return QSL("Unix");
|
||||||
#endif
|
#endif
|
||||||
#ifdef Q_OS_HAIKU
|
#ifdef Q_OS_HAIKU
|
||||||
return "Haiku";
|
return QSL("Haiku");
|
||||||
#endif
|
#endif
|
||||||
#ifdef Q_OS_WIN32
|
#ifdef Q_OS_WIN32
|
||||||
QString str = "Windows";
|
QString str = QSL("Windows");
|
||||||
|
|
||||||
switch (QSysInfo::windowsVersion()) {
|
switch (QSysInfo::windowsVersion()) {
|
||||||
case QSysInfo::WV_NT:
|
case QSysInfo::WV_NT:
|
||||||
str.append(" NT");
|
str.append(QSL(" NT"));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case QSysInfo::WV_2000:
|
case QSysInfo::WV_2000:
|
||||||
str.append(" 2000");
|
str.append(QSL(" 2000"));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case QSysInfo::WV_XP:
|
case QSysInfo::WV_XP:
|
||||||
str.append(" XP");
|
str.append(QSL(" XP"));
|
||||||
break;
|
break;
|
||||||
case QSysInfo::WV_2003:
|
case QSysInfo::WV_2003:
|
||||||
str.append(" XP Pro x64");
|
str.append(QSL(" XP Pro x64"));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case QSysInfo::WV_VISTA:
|
case QSysInfo::WV_VISTA:
|
||||||
str.append(" Vista");
|
str.append(QSL(" Vista"));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case QSysInfo::WV_WINDOWS7:
|
case QSysInfo::WV_WINDOWS7:
|
||||||
str.append(" 7");
|
str.append(QSL(" 7"));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case QSysInfo::WV_WINDOWS8:
|
case QSysInfo::WV_WINDOWS8:
|
||||||
str.append(" 8");
|
str.append(QSL(" 8"));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case QSysInfo::WV_WINDOWS8_1:
|
case QSysInfo::WV_WINDOWS8_1:
|
||||||
str.append(" 8.1");
|
str.append(QSL(" 8.1"));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case QSysInfo::WV_WINDOWS10:
|
case QSysInfo::WV_WINDOWS10:
|
||||||
str.append(" 10");
|
str.append(QSL(" 10"));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
@ -232,7 +232,7 @@ QString Scripts::sendPostData(const QUrl &url, const QByteArray &data)
|
|||||||
"form.appendChild(val);");
|
"form.appendChild(val);");
|
||||||
|
|
||||||
QString values;
|
QString values;
|
||||||
QUrlQuery query(data);
|
QUrlQuery query(QString::fromUtf8(data));
|
||||||
|
|
||||||
const auto &queryItems = query.queryItems(QUrl::FullyDecoded);
|
const auto &queryItems = query.queryItems(QUrl::FullyDecoded);
|
||||||
for (int i = 0; i < queryItems.size(); ++i) {
|
for (int i = 0; i < queryItems.size(); ++i) {
|
||||||
@ -273,7 +273,7 @@ QString Scripts::completeFormData(const QByteArray &data)
|
|||||||
""
|
""
|
||||||
"})()");
|
"})()");
|
||||||
|
|
||||||
QString d = data;
|
QString d = QString::fromUtf8(data);
|
||||||
d.replace(QL1S("'"), QL1S("\\'"));
|
d.replace(QL1S("'"), QL1S("\\'"));
|
||||||
return source.arg(d);
|
return source.arg(d);
|
||||||
}
|
}
|
||||||
|
@ -328,7 +328,7 @@ void WebPage::handleUnknownProtocol(const QUrl &url)
|
|||||||
CheckBoxDialog dialog(QMessageBox::Yes | QMessageBox::No, view());
|
CheckBoxDialog dialog(QMessageBox::Yes | QMessageBox::No, view());
|
||||||
dialog.setDefaultButton(QMessageBox::Yes);
|
dialog.setDefaultButton(QMessageBox::Yes);
|
||||||
|
|
||||||
const QString wrappedUrl = QzTools::alignTextToWidth(url.toString(), "<br/>", dialog.fontMetrics(), 450);
|
const QString wrappedUrl = QzTools::alignTextToWidth(url.toString(), QSL("<br/>"), dialog.fontMetrics(), 450);
|
||||||
const QString text = tr("Falkon cannot handle <b>%1:</b> links. The requested link "
|
const QString text = tr("Falkon cannot handle <b>%1:</b> links. The requested link "
|
||||||
"is <ul><li>%2</li></ul>Do you want Falkon to try "
|
"is <ul><li>%2</li></ul>Do you want Falkon to try "
|
||||||
"open this link in system application?").arg(protocol, wrappedUrl);
|
"open this link in system application?").arg(protocol, wrappedUrl);
|
||||||
@ -413,7 +413,7 @@ void WebPage::renderProcessTerminated(QWebEnginePage::RenderProcessTerminationSt
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
QTimer::singleShot(0, this, [this]() {
|
QTimer::singleShot(0, this, [this]() {
|
||||||
QString page = QzTools::readAllFileContents(":html/tabcrash.html");
|
QString page = QzTools::readAllFileContents(QSL(":html/tabcrash.html"));
|
||||||
page.replace(QL1S("%IMAGE%"), QzTools::pixmapToDataUrl(IconProvider::standardIcon(QStyle::SP_MessageBoxWarning).pixmap(45)).toString());
|
page.replace(QL1S("%IMAGE%"), QzTools::pixmapToDataUrl(IconProvider::standardIcon(QStyle::SP_MessageBoxWarning).pixmap(45)).toString());
|
||||||
page.replace(QL1S("%TITLE%"), tr("Failed loading page"));
|
page.replace(QL1S("%TITLE%"), tr("Failed loading page"));
|
||||||
page.replace(QL1S("%HEADING%"), tr("Failed loading page"));
|
page.replace(QL1S("%HEADING%"), tr("Failed loading page"));
|
||||||
@ -421,7 +421,7 @@ void WebPage::renderProcessTerminated(QWebEnginePage::RenderProcessTerminationSt
|
|||||||
page.replace(QL1S("%LI-2%"), tr("Try reloading the page or closing some tabs to make more memory available."));
|
page.replace(QL1S("%LI-2%"), tr("Try reloading the page or closing some tabs to make more memory available."));
|
||||||
page.replace(QL1S("%RELOAD-PAGE%"), tr("Reload page"));
|
page.replace(QL1S("%RELOAD-PAGE%"), tr("Reload page"));
|
||||||
page = QzTools::applyDirectionToPage(page);
|
page = QzTools::applyDirectionToPage(page);
|
||||||
setHtml(page.toUtf8(), url());
|
setHtml(page, url());
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -480,11 +480,11 @@ QStringList WebPage::chooseFiles(QWebEnginePage::FileSelectionMode mode, const Q
|
|||||||
|
|
||||||
switch (mode) {
|
switch (mode) {
|
||||||
case FileSelectOpen:
|
case FileSelectOpen:
|
||||||
files = QStringList(QzTools::getOpenFileName("WebPage-ChooseFile", view(), tr("Choose file..."), suggestedFileName));
|
files = QStringList(QzTools::getOpenFileName(QSL("WebPage-ChooseFile"), view(), tr("Choose file..."), suggestedFileName));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case FileSelectOpenMultiple:
|
case FileSelectOpenMultiple:
|
||||||
files = QzTools::getOpenFileNames("WebPage-ChooseFile", view(), tr("Choose files..."), suggestedFileName);
|
files = QzTools::getOpenFileNames(QSL("WebPage-ChooseFile"), view(), tr("Choose files..."), suggestedFileName);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
@ -622,7 +622,7 @@ void WebPage::javaScriptAlert(const QUrl &securityOrigin, const QString &msg)
|
|||||||
if (!kEnableJsNonBlockDialogs) {
|
if (!kEnableJsNonBlockDialogs) {
|
||||||
QString title = tr("JavaScript alert");
|
QString title = tr("JavaScript alert");
|
||||||
if (!url().host().isEmpty()) {
|
if (!url().host().isEmpty()) {
|
||||||
title.append(QString(" - %1").arg(url().host()));
|
title.append(QSL(" - %1").arg(url().host()));
|
||||||
}
|
}
|
||||||
|
|
||||||
CheckBoxDialog dialog(QMessageBox::Ok, view());
|
CheckBoxDialog dialog(QMessageBox::Ok, view());
|
||||||
|
@ -387,7 +387,7 @@ void WebView::printPage()
|
|||||||
Q_ASSERT(m_page);
|
Q_ASSERT(m_page);
|
||||||
|
|
||||||
auto *printer = new QPrinter();
|
auto *printer = new QPrinter();
|
||||||
printer->setCreator(tr("Falkon %1 (%2)").arg(Qz::VERSION, Qz::WWWADDRESS));
|
printer->setCreator(tr("Falkon %1 (%2)").arg(QString::fromLatin1(Qz::VERSION), QString::fromLatin1(Qz::WWWADDRESS)));
|
||||||
printer->setDocName(QzTools::filterCharsFromFilename(title()));
|
printer->setDocName(QzTools::filterCharsFromFilename(title()));
|
||||||
|
|
||||||
auto *dialog = new QPrintDialog(printer, this);
|
auto *dialog = new QPrintDialog(printer, this);
|
||||||
@ -482,14 +482,14 @@ void WebView::sendTextByMail()
|
|||||||
|
|
||||||
void WebView::sendPageByMail()
|
void WebView::sendPageByMail()
|
||||||
{
|
{
|
||||||
const QUrl mailUrl = QUrl::fromEncoded("mailto:%20?body=" + QUrl::toPercentEncoding(url().toEncoded()) + "&subject=" + QUrl::toPercentEncoding(title()));
|
const QUrl mailUrl = QUrl::fromEncoded("mailto:%20?body=" + QUrl::toPercentEncoding(QString::fromUtf8(url().toEncoded())) + "&subject=" + QUrl::toPercentEncoding(title()));
|
||||||
QDesktopServices::openUrl(mailUrl);
|
QDesktopServices::openUrl(mailUrl);
|
||||||
}
|
}
|
||||||
|
|
||||||
void WebView::copyLinkToClipboard()
|
void WebView::copyLinkToClipboard()
|
||||||
{
|
{
|
||||||
if (auto* action = qobject_cast<QAction*>(sender())) {
|
if (auto* action = qobject_cast<QAction*>(sender())) {
|
||||||
QApplication::clipboard()->setText(action->data().toUrl().toEncoded());
|
QApplication::clipboard()->setText(QString::fromUtf8(action->data().toUrl().toEncoded()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -753,7 +753,7 @@ void WebView::createPageContextMenu(QMenu* menu)
|
|||||||
// Special menu for Speed Dial page
|
// Special menu for Speed Dial page
|
||||||
if (url().toString() == QL1S("falkon:speeddial")) {
|
if (url().toString() == QL1S("falkon:speeddial")) {
|
||||||
menu->addSeparator();
|
menu->addSeparator();
|
||||||
menu->addAction(QIcon::fromTheme("list-add"), tr("&Add New Page"), this, &WebView::addSpeedDial);
|
menu->addAction(QIcon::fromTheme(QSL("list-add")), tr("&Add New Page"), this, &WebView::addSpeedDial);
|
||||||
menu->addAction(IconProvider::settingsIcon(), tr("&Configure Speed Dial"), this, &WebView::configureSpeedDial);
|
menu->addAction(IconProvider::settingsIcon(), tr("&Configure Speed Dial"), this, &WebView::configureSpeedDial);
|
||||||
menu->addSeparator();
|
menu->addSeparator();
|
||||||
menu->addAction(QIcon::fromTheme(QSL("view-refresh")), tr("Reload All Dials"), this, &WebView::reloadAllSpeedDials);
|
menu->addAction(QIcon::fromTheme(QSL("view-refresh")), tr("Reload All Dials"), this, &WebView::reloadAllSpeedDials);
|
||||||
@ -775,22 +775,22 @@ void WebView::createPageContextMenu(QMenu* menu)
|
|||||||
});
|
});
|
||||||
|
|
||||||
menu->addSeparator();
|
menu->addSeparator();
|
||||||
menu->addAction(QIcon::fromTheme("bookmark-new"), tr("Book&mark page"), this, &WebView::bookmarkLink);
|
menu->addAction(QIcon::fromTheme(QSL("bookmark-new")), tr("Book&mark page"), this, &WebView::bookmarkLink);
|
||||||
menu->addAction(QIcon::fromTheme("document-save"), tr("&Save page as..."), this, &WebView::savePageAs);
|
menu->addAction(QIcon::fromTheme(QSL("document-save")), tr("&Save page as..."), this, &WebView::savePageAs);
|
||||||
menu->addAction(QIcon::fromTheme("edit-copy"), tr("&Copy page link"), this, &WebView::copyLinkToClipboard)->setData(url());
|
menu->addAction(QIcon::fromTheme(QSL("edit-copy")), tr("&Copy page link"), this, &WebView::copyLinkToClipboard)->setData(url());
|
||||||
menu->addAction(QIcon::fromTheme("mail-message-new"), tr("Send page link..."), this, &WebView::sendPageByMail);
|
menu->addAction(QIcon::fromTheme(QSL("mail-message-new")), tr("Send page link..."), this, &WebView::sendPageByMail);
|
||||||
menu->addSeparator();
|
menu->addSeparator();
|
||||||
menu->addAction(QIcon::fromTheme("edit-select-all"), tr("Select &all"), this, &WebView::editSelectAll);
|
menu->addAction(QIcon::fromTheme(QSL("edit-select-all")), tr("Select &all"), this, &WebView::editSelectAll);
|
||||||
menu->addSeparator();
|
menu->addSeparator();
|
||||||
|
|
||||||
const QString scheme = url().scheme();
|
const QString scheme = url().scheme();
|
||||||
|
|
||||||
if (scheme != QL1S("view-source") && WebPage::internalSchemes().contains(scheme)) {
|
if (scheme != QL1S("view-source") && WebPage::internalSchemes().contains(scheme)) {
|
||||||
menu->addAction(QIcon::fromTheme("text-html"), tr("Show so&urce code"), this, &WebView::showSource);
|
menu->addAction(QIcon::fromTheme(QSL("text-html")), tr("Show so&urce code"), this, &WebView::showSource);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (SiteInfo::canShowSiteInfo(url()))
|
if (SiteInfo::canShowSiteInfo(url()))
|
||||||
menu->addAction(QIcon::fromTheme("dialog-information"), tr("Show info ab&out site"), this, &WebView::showSiteInfo);
|
menu->addAction(QIcon::fromTheme(QSL("dialog-information")), tr("Show info ab&out site"), this, &WebView::showSiteInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
void WebView::createLinkContextMenu(QMenu* menu, const WebHitTestResult &hitTest)
|
void WebView::createLinkContextMenu(QMenu* menu, const WebHitTestResult &hitTest)
|
||||||
@ -807,15 +807,15 @@ void WebView::createLinkContextMenu(QMenu* menu, const WebHitTestResult &hitTest
|
|||||||
|
|
||||||
QVariantList bData;
|
QVariantList bData;
|
||||||
bData << hitTest.linkUrl() << hitTest.linkTitle();
|
bData << hitTest.linkUrl() << hitTest.linkTitle();
|
||||||
menu->addAction(QIcon::fromTheme("bookmark-new"), tr("B&ookmark link"), this, &WebView::bookmarkLink)->setData(bData);
|
menu->addAction(QIcon::fromTheme(QSL("bookmark-new")), tr("B&ookmark link"), this, &WebView::bookmarkLink)->setData(bData);
|
||||||
|
|
||||||
menu->addAction(QIcon::fromTheme("document-save"), tr("&Save link as..."), this, &WebView::downloadLinkToDisk);
|
menu->addAction(QIcon::fromTheme(QSL("document-save")), tr("&Save link as..."), this, &WebView::downloadLinkToDisk);
|
||||||
menu->addAction(QIcon::fromTheme("mail-message-new"), tr("Send link..."), this, &WebView::sendTextByMail)->setData(hitTest.linkUrl().toEncoded());
|
menu->addAction(QIcon::fromTheme(QSL("mail-message-new")), tr("Send link..."), this, &WebView::sendTextByMail)->setData(hitTest.linkUrl().toEncoded());
|
||||||
menu->addAction(QIcon::fromTheme("edit-copy"), tr("&Copy link address"), this, &WebView::copyLinkToClipboard)->setData(hitTest.linkUrl());
|
menu->addAction(QIcon::fromTheme(QSL("edit-copy")), tr("&Copy link address"), this, &WebView::copyLinkToClipboard)->setData(hitTest.linkUrl());
|
||||||
menu->addSeparator();
|
menu->addSeparator();
|
||||||
|
|
||||||
if (!selectedText().isEmpty()) {
|
if (!selectedText().isEmpty()) {
|
||||||
pageAction(QWebEnginePage::Copy)->setIcon(QIcon::fromTheme("edit-copy"));
|
pageAction(QWebEnginePage::Copy)->setIcon(QIcon::fromTheme(QSL("edit-copy")));
|
||||||
menu->addAction(pageAction(QWebEnginePage::Copy));
|
menu->addAction(pageAction(QWebEnginePage::Copy));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -831,14 +831,14 @@ void WebView::createImageContextMenu(QMenu* menu, const WebHitTestResult &hitTes
|
|||||||
menu->addAction(act);
|
menu->addAction(act);
|
||||||
}
|
}
|
||||||
menu->addAction(tr("Copy image"), this, &WebView::copyImageToClipboard);
|
menu->addAction(tr("Copy image"), this, &WebView::copyImageToClipboard);
|
||||||
menu->addAction(QIcon::fromTheme("edit-copy"), tr("Copy image ad&dress"), this, &WebView::copyLinkToClipboard)->setData(hitTest.imageUrl());
|
menu->addAction(QIcon::fromTheme(QSL("edit-copy")), tr("Copy image ad&dress"), this, &WebView::copyLinkToClipboard)->setData(hitTest.imageUrl());
|
||||||
menu->addSeparator();
|
menu->addSeparator();
|
||||||
menu->addAction(QIcon::fromTheme("document-save"), tr("&Save image as..."), this, &WebView::downloadImageToDisk);
|
menu->addAction(QIcon::fromTheme(QSL("document-save")), tr("&Save image as..."), this, &WebView::downloadImageToDisk);
|
||||||
menu->addAction(QIcon::fromTheme("mail-message-new"), tr("Send image..."), this, &WebView::sendTextByMail)->setData(hitTest.imageUrl().toEncoded());
|
menu->addAction(QIcon::fromTheme(QSL("mail-message-new")), tr("Send image..."), this, &WebView::sendTextByMail)->setData(hitTest.imageUrl().toEncoded());
|
||||||
menu->addSeparator();
|
menu->addSeparator();
|
||||||
|
|
||||||
if (!selectedText().isEmpty()) {
|
if (!selectedText().isEmpty()) {
|
||||||
pageAction(QWebEnginePage::Copy)->setIcon(QIcon::fromTheme("edit-copy"));
|
pageAction(QWebEnginePage::Copy)->setIcon(QIcon::fromTheme(QSL("edit-copy")));
|
||||||
menu->addAction(pageAction(QWebEnginePage::Copy));
|
menu->addAction(pageAction(QWebEnginePage::Copy));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -853,7 +853,7 @@ void WebView::createSelectedTextContextMenu(QMenu* menu, const WebHitTestResult
|
|||||||
if (!menu->actions().contains(pageAction(QWebEnginePage::Copy))) {
|
if (!menu->actions().contains(pageAction(QWebEnginePage::Copy))) {
|
||||||
menu->addAction(pageAction(QWebEnginePage::Copy));
|
menu->addAction(pageAction(QWebEnginePage::Copy));
|
||||||
}
|
}
|
||||||
menu->addAction(QIcon::fromTheme("mail-message-new"), tr("Send text..."), this, &WebView::sendTextByMail)->setData(selectedText);
|
menu->addAction(QIcon::fromTheme(QSL("mail-message-new")), tr("Send text..."), this, &WebView::sendTextByMail)->setData(selectedText);
|
||||||
menu->addSeparator();
|
menu->addSeparator();
|
||||||
|
|
||||||
// #379: Remove newlines
|
// #379: Remove newlines
|
||||||
@ -865,7 +865,7 @@ void WebView::createSelectedTextContextMenu(QMenu* menu, const WebHitTestResult
|
|||||||
QUrl guessedUrl = QUrl::fromUserInput(selectedString);
|
QUrl guessedUrl = QUrl::fromUserInput(selectedString);
|
||||||
|
|
||||||
if (isUrlValid(guessedUrl)) {
|
if (isUrlValid(guessedUrl)) {
|
||||||
auto* act = new Action(QIcon::fromTheme("document-open-remote"), tr("Go to &web address"));
|
auto* act = new Action(QIcon::fromTheme(QSL("document-open-remote")), tr("Go to &web address"));
|
||||||
act->setData(guessedUrl);
|
act->setData(guessedUrl);
|
||||||
|
|
||||||
connect(act, &QAction::triggered, this, &WebView::openActionUrl);
|
connect(act, &QAction::triggered, this, &WebView::openActionUrl);
|
||||||
@ -907,12 +907,12 @@ void WebView::createMediaContextMenu(QMenu *menu, const WebHitTestResult &hitTes
|
|||||||
bool muted = hitTest.mediaMuted();
|
bool muted = hitTest.mediaMuted();
|
||||||
|
|
||||||
menu->addSeparator();
|
menu->addSeparator();
|
||||||
menu->addAction(paused ? tr("&Play") : tr("&Pause"), this, &WebView::toggleMediaPause)->setIcon(QIcon::fromTheme(paused ? "media-playback-start" : "media-playback-pause"));
|
menu->addAction(paused ? tr("&Play") : tr("&Pause"), this, &WebView::toggleMediaPause)->setIcon(QIcon::fromTheme(paused ? QSL("media-playback-start") : QSL("media-playback-pause")));
|
||||||
menu->addAction(muted ? tr("Un&mute") : tr("&Mute"), this, &WebView::toggleMediaMute)->setIcon(QIcon::fromTheme(muted ? "audio-volume-muted" : "audio-volume-high"));
|
menu->addAction(muted ? tr("Un&mute") : tr("&Mute"), this, &WebView::toggleMediaMute)->setIcon(QIcon::fromTheme(muted ? QSL("audio-volume-muted") : QSL("audio-volume-high")));
|
||||||
menu->addSeparator();
|
menu->addSeparator();
|
||||||
menu->addAction(QIcon::fromTheme("edit-copy"), tr("&Copy Media Address"), this, &WebView::copyLinkToClipboard)->setData(hitTest.mediaUrl());
|
menu->addAction(QIcon::fromTheme(QSL("edit-copy")), tr("&Copy Media Address"), this, &WebView::copyLinkToClipboard)->setData(hitTest.mediaUrl());
|
||||||
menu->addAction(QIcon::fromTheme("mail-message-new"), tr("&Send Media Address"), this, &WebView::sendTextByMail)->setData(hitTest.mediaUrl().toEncoded());
|
menu->addAction(QIcon::fromTheme(QSL("mail-message-new")), tr("&Send Media Address"), this, &WebView::sendTextByMail)->setData(hitTest.mediaUrl().toEncoded());
|
||||||
menu->addAction(QIcon::fromTheme("document-save"), tr("Save Media To &Disk"), this, &WebView::downloadMediaToDisk);
|
menu->addAction(QIcon::fromTheme(QSL("document-save")), tr("Save Media To &Disk"), this, &WebView::downloadMediaToDisk);
|
||||||
}
|
}
|
||||||
|
|
||||||
void WebView::checkForForm(QAction *action, const QPoint &pos)
|
void WebView::checkForForm(QAction *action, const QPoint &pos)
|
||||||
@ -946,17 +946,17 @@ void WebView::createSearchEngine()
|
|||||||
|
|
||||||
void WebView::addSpeedDial()
|
void WebView::addSpeedDial()
|
||||||
{
|
{
|
||||||
page()->runJavaScript("addSpeedDial()", WebPage::SafeJsWorld);
|
page()->runJavaScript(QSL("addSpeedDial()"), WebPage::SafeJsWorld);
|
||||||
}
|
}
|
||||||
|
|
||||||
void WebView::configureSpeedDial()
|
void WebView::configureSpeedDial()
|
||||||
{
|
{
|
||||||
page()->runJavaScript("configureSpeedDial()", WebPage::SafeJsWorld);
|
page()->runJavaScript(QSL("configureSpeedDial()"), WebPage::SafeJsWorld);
|
||||||
}
|
}
|
||||||
|
|
||||||
void WebView::reloadAllSpeedDials()
|
void WebView::reloadAllSpeedDials()
|
||||||
{
|
{
|
||||||
page()->runJavaScript("reloadAll()", WebPage::SafeJsWorld);
|
page()->runJavaScript(QSL("reloadAll()"), WebPage::SafeJsWorld);
|
||||||
}
|
}
|
||||||
|
|
||||||
void WebView::toggleMediaPause()
|
void WebView::toggleMediaPause()
|
||||||
@ -973,37 +973,37 @@ void WebView::initializeActions()
|
|||||||
{
|
{
|
||||||
QAction* undoAction = pageAction(QWebEnginePage::Undo);
|
QAction* undoAction = pageAction(QWebEnginePage::Undo);
|
||||||
undoAction->setText(tr("&Undo"));
|
undoAction->setText(tr("&Undo"));
|
||||||
undoAction->setShortcut(QKeySequence("Ctrl+Z"));
|
undoAction->setShortcut(QKeySequence(QSL("Ctrl+Z")));
|
||||||
undoAction->setShortcutContext(Qt::WidgetWithChildrenShortcut);
|
undoAction->setShortcutContext(Qt::WidgetWithChildrenShortcut);
|
||||||
undoAction->setIcon(QIcon::fromTheme(QSL("edit-undo")));
|
undoAction->setIcon(QIcon::fromTheme(QSL("edit-undo")));
|
||||||
|
|
||||||
QAction* redoAction = pageAction(QWebEnginePage::Redo);
|
QAction* redoAction = pageAction(QWebEnginePage::Redo);
|
||||||
redoAction->setText(tr("&Redo"));
|
redoAction->setText(tr("&Redo"));
|
||||||
redoAction->setShortcut(QKeySequence("Ctrl+Shift+Z"));
|
redoAction->setShortcut(QKeySequence(QSL("Ctrl+Shift+Z")));
|
||||||
redoAction->setShortcutContext(Qt::WidgetWithChildrenShortcut);
|
redoAction->setShortcutContext(Qt::WidgetWithChildrenShortcut);
|
||||||
redoAction->setIcon(QIcon::fromTheme(QSL("edit-redo")));
|
redoAction->setIcon(QIcon::fromTheme(QSL("edit-redo")));
|
||||||
|
|
||||||
QAction* cutAction = pageAction(QWebEnginePage::Cut);
|
QAction* cutAction = pageAction(QWebEnginePage::Cut);
|
||||||
cutAction->setText(tr("&Cut"));
|
cutAction->setText(tr("&Cut"));
|
||||||
cutAction->setShortcut(QKeySequence("Ctrl+X"));
|
cutAction->setShortcut(QKeySequence(QSL("Ctrl+X")));
|
||||||
cutAction->setShortcutContext(Qt::WidgetWithChildrenShortcut);
|
cutAction->setShortcutContext(Qt::WidgetWithChildrenShortcut);
|
||||||
cutAction->setIcon(QIcon::fromTheme(QSL("edit-cut")));
|
cutAction->setIcon(QIcon::fromTheme(QSL("edit-cut")));
|
||||||
|
|
||||||
QAction* copyAction = pageAction(QWebEnginePage::Copy);
|
QAction* copyAction = pageAction(QWebEnginePage::Copy);
|
||||||
copyAction->setText(tr("&Copy"));
|
copyAction->setText(tr("&Copy"));
|
||||||
copyAction->setShortcut(QKeySequence("Ctrl+C"));
|
copyAction->setShortcut(QKeySequence(QSL("Ctrl+C")));
|
||||||
copyAction->setShortcutContext(Qt::WidgetWithChildrenShortcut);
|
copyAction->setShortcutContext(Qt::WidgetWithChildrenShortcut);
|
||||||
copyAction->setIcon(QIcon::fromTheme(QSL("edit-copy")));
|
copyAction->setIcon(QIcon::fromTheme(QSL("edit-copy")));
|
||||||
|
|
||||||
QAction* pasteAction = pageAction(QWebEnginePage::Paste);
|
QAction* pasteAction = pageAction(QWebEnginePage::Paste);
|
||||||
pasteAction->setText(tr("&Paste"));
|
pasteAction->setText(tr("&Paste"));
|
||||||
pasteAction->setShortcut(QKeySequence("Ctrl+V"));
|
pasteAction->setShortcut(QKeySequence(QSL("Ctrl+V")));
|
||||||
pasteAction->setShortcutContext(Qt::WidgetWithChildrenShortcut);
|
pasteAction->setShortcutContext(Qt::WidgetWithChildrenShortcut);
|
||||||
pasteAction->setIcon(QIcon::fromTheme(QSL("edit-paste")));
|
pasteAction->setIcon(QIcon::fromTheme(QSL("edit-paste")));
|
||||||
|
|
||||||
QAction* selectAllAction = pageAction(QWebEnginePage::SelectAll);
|
QAction* selectAllAction = pageAction(QWebEnginePage::SelectAll);
|
||||||
selectAllAction->setText(tr("Select All"));
|
selectAllAction->setText(tr("Select All"));
|
||||||
selectAllAction->setShortcut(QKeySequence("Ctrl+A"));
|
selectAllAction->setShortcut(QKeySequence(QSL("Ctrl+A")));
|
||||||
selectAllAction->setShortcutContext(Qt::WidgetWithChildrenShortcut);
|
selectAllAction->setShortcutContext(Qt::WidgetWithChildrenShortcut);
|
||||||
selectAllAction->setIcon(QIcon::fromTheme(QSL("edit-select-all")));
|
selectAllAction->setIcon(QIcon::fromTheme(QSL("edit-select-all")));
|
||||||
|
|
||||||
|
@ -35,8 +35,8 @@ SearchToolBar::SearchToolBar(WebView* view, QWidget* parent)
|
|||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
|
||||||
ui->closeButton->setIcon(IconProvider::instance()->standardIcon(QStyle::SP_DialogCloseButton));
|
ui->closeButton->setIcon(IconProvider::instance()->standardIcon(QStyle::SP_DialogCloseButton));
|
||||||
ui->next->setShortcut(QKeySequence("Ctrl+G"));
|
ui->next->setShortcut(QKeySequence(QSL("Ctrl+G")));
|
||||||
ui->previous->setShortcut(QKeySequence("Ctrl+Shift+G"));
|
ui->previous->setShortcut(QKeySequence(QSL("Ctrl+Shift+G")));
|
||||||
|
|
||||||
ui->resultsInfo->hide();
|
ui->resultsInfo->hide();
|
||||||
connect(view->page(), &QWebEnginePage::findTextFinished, this, &SearchToolBar::showSearchResults);
|
connect(view->page(), &QWebEnginePage::findTextFinished, this, &SearchToolBar::showSearchResults);
|
||||||
@ -47,10 +47,10 @@ SearchToolBar::SearchToolBar(WebView* view, QWidget* parent)
|
|||||||
connect(ui->previous, &QAbstractButton::clicked, this, &SearchToolBar::findPrevious);
|
connect(ui->previous, &QAbstractButton::clicked, this, &SearchToolBar::findPrevious);
|
||||||
connect(ui->caseSensitive, &QAbstractButton::clicked, this, &SearchToolBar::caseSensitivityChanged);
|
connect(ui->caseSensitive, &QAbstractButton::clicked, this, &SearchToolBar::caseSensitivityChanged);
|
||||||
|
|
||||||
auto* findNextAction = new QShortcut(QKeySequence("F3"), this);
|
auto* findNextAction = new QShortcut(QKeySequence(QSL("F3")), this);
|
||||||
connect(findNextAction, &QShortcut::activated, this, &SearchToolBar::findNext);
|
connect(findNextAction, &QShortcut::activated, this, &SearchToolBar::findNext);
|
||||||
|
|
||||||
auto* findPreviousAction = new QShortcut(QKeySequence("Shift+F3"), this);
|
auto* findPreviousAction = new QShortcut(QKeySequence(QSL("Shift+F3")), this);
|
||||||
connect(findPreviousAction, &QShortcut::activated, this, &SearchToolBar::findPrevious);
|
connect(findPreviousAction, &QShortcut::activated, this, &SearchToolBar::findPrevious);
|
||||||
|
|
||||||
parent->installEventFilter(this);
|
parent->installEventFilter(this);
|
||||||
|
@ -59,7 +59,7 @@ int main(int argc, char* argv[])
|
|||||||
for (int i = 0; i < argc; ++i)
|
for (int i = 0; i < argc; ++i)
|
||||||
args[i] = argv[i];
|
args[i] = argv[i];
|
||||||
|
|
||||||
QString stylecmd = QL1S("-style=") + style;
|
QString stylecmd = QL1S("-style=") + QString::fromUtf8(style);
|
||||||
args[argc++] = qstrdup(stylecmd.toUtf8().constData());
|
args[argc++] = qstrdup(stylecmd.toUtf8().constData());
|
||||||
argv = args;
|
argv = args;
|
||||||
}
|
}
|
||||||
|
@ -49,7 +49,7 @@ void AutoScrollPlugin::unload()
|
|||||||
bool AutoScrollPlugin::testPlugin()
|
bool AutoScrollPlugin::testPlugin()
|
||||||
{
|
{
|
||||||
// Require the version that the plugin was built with
|
// Require the version that the plugin was built with
|
||||||
return (Qz::VERSION == QLatin1String(FALKON_VERSION));
|
return (QString::fromLatin1(Qz::VERSION) == QLatin1String(FALKON_VERSION));
|
||||||
}
|
}
|
||||||
|
|
||||||
void AutoScrollPlugin::showSettings(QWidget* parent)
|
void AutoScrollPlugin::showSettings(QWidget* parent)
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user