Skip to content

Commit

Permalink
== Version 1.99.3 ==
Browse files Browse the repository at this point in the history
  * Add persistent cookie storage. Thanks to quinox.
  * Add 'Backspace' hot-key to go back through page history.
  * Fix persistent cookies for Qt 4.8 support
  • Loading branch information
Sergey Dryabzhinsky committed Aug 25, 2014
1 parent 8d4f669 commit 7fe40a3
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 21 deletions.
7 changes: 7 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
qt-webkit-kiosk (1.99.3-1sergey1) unstable; urgency=medium

* Add persistent cookie storage. Thanks to quinox.
* Add 'Backspace' hot-key to go back through page history.

-- Sergey Dryabzhinsky <[email protected]> Mon, 26 Aug 2014 02:13:00 +0400

qt-webkit-kiosk (1.99.2-1sergey1) unstable; urgency=medium

* Fixed dependencies checks for *nix
Expand Down
2 changes: 2 additions & 0 deletions doc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,7 @@ PgUp Scroll Page Up
PgDown Scroll Page Down
Home Scroll to top
End Scroll to bottom

Ctrl+Home,
HomePage Load home page
Backspace Go back via pages history
4 changes: 2 additions & 2 deletions resources/qt-webkit-kiosk.ini
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ cookiejar=false
java=false
javascript=true
; handle window.open?
; canch link and follow. no new windows.
; catch link and follow. no new windows.
javascript_can_open_windows=true
; handle window.close ?
javascript_can_close_windows=false
Expand Down Expand Up @@ -87,7 +87,7 @@ clean-on-exit=false
organization=Organization
organization-domain=www.example.com
name=QtWebkitKiosk
version=1.99.2
version=1.99.3

[printing]
enable=false
Expand Down
2 changes: 1 addition & 1 deletion src/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#endif

#ifndef VERSION
#define VERSION "1.99.2"
#define VERSION "1.99.3"
#endif

#endif
3 changes: 3 additions & 0 deletions src/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,9 @@ void MainWindow::keyPressEvent(QKeyEvent *event)
view->scrollHome();
}
break;
case Qt::Key_Backspace:
view->page()->triggerAction(QWebPage::Back);
break;
case Qt::Key_Q:
if (int(event->modifiers()) == Qt::CTRL) {
clearCacheOnExit();
Expand Down
22 changes: 12 additions & 10 deletions src/persistentcookiejar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@ const char *PersistentCookieJar::line_separator = "\n";
PersistentCookieJar::PersistentCookieJar(QObject *parent) :
QNetworkCookieJar(parent)
{
QString cookiejar_path = QStandardPaths::writableLocation(QStandardPaths::DataLocation);
#ifdef QT5
QString cookiejar_path = QStandardPaths::writableLocation(QStandardPaths::DataLocation);
#else
QString cookiejar_path = QDesktopServices::storageLocation(QDesktopServices::DataLocation);
#endif

if (cookiejar_path.length() == 0) {
qDebug() << "No data locations available; not storing any cookies.";
Expand All @@ -25,7 +29,7 @@ PersistentCookieJar::PersistentCookieJar(QObject *parent) :
cookiejar_dir.mkpath(".");
}

cookiejar_location = cookiejar_path + "/cookiejar.txt";
cookiejar_location = cookiejar_path + QDir::toNativeSeparators("/cookiejar.txt");

load();
}
Expand All @@ -49,7 +53,7 @@ void PersistentCookieJar::store() {

for (int i=0; i < cookies.length(); i++)
{
qDebug() << "Writing cookie " + i;
qDebug() << "Writing cookie " << i;
storage.write(cookies[i].toRawForm());
storage.write(line_separator);
}
Expand All @@ -68,16 +72,14 @@ void PersistentCookieJar::load() {
QByteArray bytes = storage.readAll();
QList<QByteArray> cookies = bytes.split(*line_separator);

int valid_cookies = 0;
QList<QNetworkCookie> all_cookies = QNetworkCookie::parseCookies(";");

for (int i=0; i < cookies.length(); i++) {
QList<QNetworkCookie> parsed_cookies = QNetworkCookie::parseCookies(cookies[i]);
for (int j=0; j < parsed_cookies.length(); j++) {
insertCookie(parsed_cookies[j]);
valid_cookies++;
}
all_cookies += QNetworkCookie::parseCookies(cookies[i]);
}

qDebug() << "Read" << valid_cookies << "valid cookies from the cookiejar.";
setAllCookies(all_cookies);

qDebug() << "Read" << all_cookies.length() << "valid cookies from the cookiejar.";
storage.close();
}
16 changes: 8 additions & 8 deletions src/qt-webkit-kiosk.pro
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ contains(QT_VERSION, ^5\\.[0-9]\\..*) {
CONFIG += console link_pkgconfig
TARGET = qt-webkit-kiosk
TEMPLATE = app
VERSION = 1.99.2
VERSION = 1.99.3

CONFIG(debug, debug|release) {
# here comes debug specific statements
Expand All @@ -38,12 +38,12 @@ PLAYER = NONE
DEFINES += RESOURCES=\\\"$${PREFIX}/share/$${TARGET}/\\\"
DEFINES += ICON=\\\"$${ICON}\\\"
PKG_TEST=QtTest

PKG_TEST=QtTest

contains(QT_VERSION, ^5\\.[0-9]\\..*) {

PKG_TEST=Qt5Test


PKG_TEST=Qt5Test

packagesExist(Qt5Multimedia) {
message('Multimedia framework found. Using Multimedia-player.')
DEFINES += PLAYER_MULTIMEDIA
Expand All @@ -53,7 +53,7 @@ contains(QT_VERSION, ^5\\.[0-9]\\..*) {
HEADERS += player/multimedia.h
}
}


contains(PLAYER, NONE) {
packagesExist(phonon) {
message('Phonon framework found. Using Phonon-player.')
Expand All @@ -64,7 +64,7 @@ contains(QT_VERSION, ^5\\.[0-9]\\..*) {
HEADERS += player/phonon.h
}
}


packagesExist($${PKG_TEST}) {
message('Test framework found.')
DEFINES += USE_TESTLIB
Expand Down

0 comments on commit 7fe40a3

Please sign in to comment.