This is an automated email from the git hooks/post-receive script. x2go pushed a change to branch feature/cleanup in repository x2goclient. from 21eac48 x2goclient.pro: work around another bug in qmake and copy icon "manually". new 0a9a0a6 general: define wrap_legacy_resources() function and use it to wrap legacy resource locations stored in old session config files. new 6c6f012 sessionbuttons/userbuttons: add some debugging output to see what file path is being used as a pixmap (user photo/session icon.) new 981bbfa x2goutils: update copyright -- add myself. new 7b5130a x2goutils.cpp: change four spaces per indentation level to two spaces. new a8a376f x2goutils.cpp: use constBegin() and constEnd() instead of begin/end... new 48acf77 x2goutils.cpp: actually use the correct iterator types and functions. new e56ade0 x2goutils: add fixup_resources() to fix "broken" resource URI's. new 5a8ddcb x2goutils: rename fixup_resources() and wrap_legacy_resources() to fixup_resource_URIs() and wrap_legacy_resource_URIs(). The 8 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "adds" were already present in the repository and have only been added to this reference. Summary of changes: debian/changelog | 10 +++++++++ src/onmainwindow.cpp | 10 ++++----- src/sessionbutton.cpp | 9 ++++----- src/x2goutils.cpp | 54 ++++++++++++++++++++++++++++++++++++++++++++----- src/x2goutils.h | 5 ++++- 5 files changed, 72 insertions(+), 16 deletions(-) -- Alioth's /srv/git/_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch feature/cleanup in repository x2goclient. commit 0a9a0a64b3fd6bdc3646520269252443acca31da Author: Mihai Moldovan <ionic@ionic.de> Date: Sat Feb 14 23:17:07 2015 +0100 general: define wrap_legacy_resources() function and use it to wrap legacy resource locations stored in old session config files. --- debian/changelog | 2 ++ src/onmainwindow.cpp | 10 +++++----- src/sessionbutton.cpp | 9 ++++----- src/x2goutils.cpp | 29 +++++++++++++++++++++++++++++ src/x2goutils.h | 1 + 5 files changed, 41 insertions(+), 10 deletions(-) diff --git a/debian/changelog b/debian/changelog index b15dc3a..f01bfe9 100644 --- a/debian/changelog +++ b/debian/changelog @@ -191,6 +191,8 @@ x2goclient (4.0.3.2-0x2go1) UNRELEASED; urgency=medium - Work around a bug in qmake generating incorrect make rules for embedding the OS X app bundle Info.plist file. - Work around another bug in qmake and copy icon "manually". + - Define wrap_legacy_resources() function and use it to wrap legacy + resource locations stored in old session config files. -- Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Thu, 27 Nov 2014 12:01:43 +0100 diff --git a/src/onmainwindow.cpp b/src/onmainwindow.cpp index c5b8769..f09a683 100644 --- a/src/onmainwindow.cpp +++ b/src/onmainwindow.cpp @@ -2533,11 +2533,11 @@ void ONMainWindow::slotSelectedFromList ( SessionButton* session ) - sessIcon=st->setting()->value ( - sid+"/icon", - ( QVariant ) ":/img/icons/128x128/x2gosession.png" - ).toString(); - sessIcon=expandHome(sessIcon); + sessIcon = wrap_legacy_resources (st->setting()->value ( + sid+"/icon", + (QVariant) ":/img/icons/128x128/x2gosession.png" + ).toString ()); + sessIcon = expandHome(sessIcon); command=st->setting()->value ( sid+"/command", diff --git a/src/sessionbutton.cpp b/src/sessionbutton.cpp index 8967d77..10bf4d8 100644 --- a/src/sessionbutton.cpp +++ b/src/sessionbutton.cpp @@ -310,11 +310,10 @@ void SessionButton::redraw() sessStatus->setText("("+tr("suspended")+")"); } - QString sessIcon=st->setting()->value ( - sid+"/icon", - ( QVariant ) - ":/img/icons/128x128/x2gosession.png" - ).toString(); + QString sessIcon = wrap_legacy_resources (st->setting()->value (sid+"/icon", + (QVariant) + ":/img/icons/128x128/x2gosession.png" + ).toString ()); sessIcon = expandHome(sessIcon); QPixmap* pix; diff --git a/src/x2goutils.cpp b/src/x2goutils.cpp index bd38b2a..5226c47 100644 --- a/src/x2goutils.cpp +++ b/src/x2goutils.cpp @@ -15,6 +15,8 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * ***************************************************************************/ +#include <vector> +#include <algorithm> #include <QString> #include <QDir> @@ -26,3 +28,30 @@ QString expandHome( QString path ) } return path; } + +QString wrap_legacy_resources (const QString res_path) { + QString ret (res_path); + + if (!(res_path.isEmpty ())) { + std::vector<QString> legacy_locations; + legacy_locations.push_back (QString (":/icons/")); + legacy_locations.push_back (QString (":/png/")); + legacy_locations.push_back (QString (":/svg/")); + + bool detected = false; + + /* This would be so much easier with C++ and lambdas... */ + QString::const_iterator it = legacy_locations.begin (); + while (it != legacy_locations.end ()) { + if (res_path.startsWith (*(it++))) { + detected = true; + break; + } + } + + if (detected) + ret.insert (1, QString ("/img")); + } + + return (ret); +} diff --git a/src/x2goutils.h b/src/x2goutils.h index cf9ce08..84bed3c 100644 --- a/src/x2goutils.h +++ b/src/x2goutils.h @@ -21,5 +21,6 @@ #include <QString> QString expandHome( QString path ); +QString wrap_legacy_resources (const QString res_path); #endif -- Alioth's /srv/git/_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch feature/cleanup in repository x2goclient. commit 6c6f0122443664d16446a2cba5eaa816d18a8a02 Author: Mihai Moldovan <ionic@ionic.de> Date: Sat Feb 14 23:19:07 2015 +0100 sessionbuttons/userbuttons: add some debugging output to see what file path is being used as a pixmap (user photo/session icon.) --- debian/changelog | 2 ++ src/onmainwindow.cpp | 1 + src/sessionbutton.cpp | 1 + 3 files changed, 4 insertions(+) diff --git a/debian/changelog b/debian/changelog index f01bfe9..126f16f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -193,6 +193,8 @@ x2goclient (4.0.3.2-0x2go1) UNRELEASED; urgency=medium - Work around another bug in qmake and copy icon "manually". - Define wrap_legacy_resources() function and use it to wrap legacy resource locations stored in old session config files. + - Add some debugging output to sessionbuttons/userbutton to see what file + path is being used as a pixmap (user photo/session icon.) -- Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Thu, 27 Nov 2014 12:01:43 +0100 diff --git a/src/onmainwindow.cpp b/src/onmainwindow.cpp index f09a683..cff4936 100644 --- a/src/onmainwindow.cpp +++ b/src/onmainwindow.cpp @@ -2595,6 +2595,7 @@ void ONMainWindow::slotSelectedFromList ( SessionButton* session ) selectedCommand=command.split("/").last(); command=transAppName ( command ); login->setText ( userName ); + x2goDebug << "creating QPixmap with session icon: '" << sessIcon << "'."; QPixmap pix ( sessIcon ); if ( !miniMode ) { diff --git a/src/sessionbutton.cpp b/src/sessionbutton.cpp index 10bf4d8..5690323 100644 --- a/src/sessionbutton.cpp +++ b/src/sessionbutton.cpp @@ -317,6 +317,7 @@ void SessionButton::redraw() sessIcon = expandHome(sessIcon); QPixmap* pix; + x2goDebug << "creating QPixmap with session icon: '" << sessIcon.toAscii () << "'."; if (!par->brokerMode || sessIcon == ":/img/icons/128x128/x2gosession.png") pix=new QPixmap( sessIcon ); else -- Alioth's /srv/git/_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch feature/cleanup in repository x2goclient. commit 981bbfa580ecee9cad1aa907c17949368b3b00a9 Author: Mihai Moldovan <ionic@ionic.de> Date: Sat Feb 14 23:22:40 2015 +0100 x2goutils: update copyright -- add myself. --- debian/changelog | 1 + src/x2goutils.cpp | 3 ++- src/x2goutils.h | 3 ++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 126f16f..b88d3aa 100644 --- a/debian/changelog +++ b/debian/changelog @@ -195,6 +195,7 @@ x2goclient (4.0.3.2-0x2go1) UNRELEASED; urgency=medium resource locations stored in old session config files. - Add some debugging output to sessionbuttons/userbutton to see what file path is being used as a pixmap (user photo/session icon.) + - Add myself to copyright section in the x2goutils headers. -- Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Thu, 27 Nov 2014 12:01:43 +0100 diff --git a/src/x2goutils.cpp b/src/x2goutils.cpp index 5226c47..1dadb3b 100644 --- a/src/x2goutils.cpp +++ b/src/x2goutils.cpp @@ -1,6 +1,7 @@ /************************************************************************** * Copyright (C) 2005-2015 by Oleksandr Shneyder * -* o.shneyder@phoca-gmbh.de * +* <o.shneyder@phoca-gmbh.de> * +* Copyright (C) 2015 by Mihai Moldovan <ionic@ionic.de> * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * diff --git a/src/x2goutils.h b/src/x2goutils.h index 84bed3c..0ff2e8e 100644 --- a/src/x2goutils.h +++ b/src/x2goutils.h @@ -1,6 +1,7 @@ /************************************************************************** * Copyright (C) 2005-2015 by Oleksandr Shneyder * -* o.shneyder@phoca-gmbh.de * +* <o.shneyder@phoca-gmbh.de> * +* Copyright (C) 2015 by Mihai Moldovan <ionic@ionic.de> * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * -- Alioth's /srv/git/_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch feature/cleanup in repository x2goclient. commit 7b5130ad20de6bbcef90d391f9aa620876584b96 Author: Mihai Moldovan <ionic@ionic.de> Date: Sat Feb 14 23:24:41 2015 +0100 x2goutils.cpp: change four spaces per indentation level to two spaces. --- debian/changelog | 1 + src/x2goutils.cpp | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/debian/changelog b/debian/changelog index b88d3aa..734a7fc 100644 --- a/debian/changelog +++ b/debian/changelog @@ -196,6 +196,7 @@ x2goclient (4.0.3.2-0x2go1) UNRELEASED; urgency=medium - Add some debugging output to sessionbuttons/userbutton to see what file path is being used as a pixmap (user photo/session icon.) - Add myself to copyright section in the x2goutils headers. + - Change four spaces per indentation level to two spaces in x2goutils.cpp. -- Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Thu, 27 Nov 2014 12:01:43 +0100 diff --git a/src/x2goutils.cpp b/src/x2goutils.cpp index 1dadb3b..8ddad3b 100644 --- a/src/x2goutils.cpp +++ b/src/x2goutils.cpp @@ -23,11 +23,11 @@ QString expandHome( QString path ) { - path = path.trimmed(); - if ( path.startsWith("~/") || path.startsWith("~\\") ) { - path = path.replace(QString("~"), QDir::homePath()); - } - return path; + path = path.trimmed(); + if ( path.startsWith("~/") || path.startsWith("~\\") ) { + path = path.replace(QString("~"), QDir::homePath()); + } + return path; } QString wrap_legacy_resources (const QString res_path) { -- Alioth's /srv/git/_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch feature/cleanup in repository x2goclient. commit a8a376f47b6bb0365de0933c246bc29ccef51607 Author: Mihai Moldovan <ionic@ionic.de> Date: Sat Feb 14 23:28:35 2015 +0100 x2goutils.cpp: use constBegin() and constEnd() instead of begin/end... --- src/x2goutils.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/x2goutils.cpp b/src/x2goutils.cpp index 8ddad3b..36ffac9 100644 --- a/src/x2goutils.cpp +++ b/src/x2goutils.cpp @@ -42,8 +42,8 @@ QString wrap_legacy_resources (const QString res_path) { bool detected = false; /* This would be so much easier with C++ and lambdas... */ - QString::const_iterator it = legacy_locations.begin (); - while (it != legacy_locations.end ()) { + QString::const_iterator it = legacy_locations.constBegin (); + while (it != legacy_locations.constEnd ()) { if (res_path.startsWith (*(it++))) { detected = true; break; -- Alioth's /srv/git/_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch feature/cleanup in repository x2goclient. commit 48acf77ff57330954dbd418f44b0c6246130ee1b Author: Mihai Moldovan <ionic@ionic.de> Date: Sat Feb 14 23:45:32 2015 +0100 x2goutils.cpp: actually use the correct iterator types and functions. --- src/x2goutils.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/x2goutils.cpp b/src/x2goutils.cpp index 36ffac9..d1ad13d 100644 --- a/src/x2goutils.cpp +++ b/src/x2goutils.cpp @@ -42,8 +42,8 @@ QString wrap_legacy_resources (const QString res_path) { bool detected = false; /* This would be so much easier with C++ and lambdas... */ - QString::const_iterator it = legacy_locations.constBegin (); - while (it != legacy_locations.constEnd ()) { + std::vector<QString>::const_iterator it = legacy_locations.begin (); + while (it != legacy_locations.end ()) { if (res_path.startsWith (*(it++))) { detected = true; break; -- Alioth's /srv/git/_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch feature/cleanup in repository x2goclient. commit e56ade08b004fe775145cccc05ca79e2e6854587 Author: Mihai Moldovan <ionic@ionic.de> Date: Sat Feb 14 23:54:50 2015 +0100 x2goutils: add fixup_resources() to fix "broken" resource URI's. --- debian/changelog | 1 + src/x2goutils.cpp | 16 +++++++++++++++- src/x2goutils.h | 1 + 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 734a7fc..9233265 100644 --- a/debian/changelog +++ b/debian/changelog @@ -197,6 +197,7 @@ x2goclient (4.0.3.2-0x2go1) UNRELEASED; urgency=medium path is being used as a pixmap (user photo/session icon.) - Add myself to copyright section in the x2goutils headers. - Change four spaces per indentation level to two spaces in x2goutils.cpp. + - Add fixup_resources() to x2goutils to fix "broken" resource URI's. -- Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Thu, 27 Nov 2014 12:01:43 +0100 diff --git a/src/x2goutils.cpp b/src/x2goutils.cpp index d1ad13d..a41fdf2 100644 --- a/src/x2goutils.cpp +++ b/src/x2goutils.cpp @@ -30,6 +30,18 @@ QString expandHome( QString path ) return path; } +QString fixup_resources (const QString res_path) { + QString ret (res_path); + + if (!(res_path.isEmpty ())) { + if (ret.at (1) != '/') { + ret.insert (1, '/'); + } + } + + return (ret); +} + QString wrap_legacy_resources (const QString res_path) { QString ret (res_path); @@ -39,12 +51,14 @@ QString wrap_legacy_resources (const QString res_path) { legacy_locations.push_back (QString (":/png/")); legacy_locations.push_back (QString (":/svg/")); + ret = fixup_resources (ret); + bool detected = false; /* This would be so much easier with C++ and lambdas... */ std::vector<QString>::const_iterator it = legacy_locations.begin (); while (it != legacy_locations.end ()) { - if (res_path.startsWith (*(it++))) { + if (ret.startsWith (*(it++))) { detected = true; break; } diff --git a/src/x2goutils.h b/src/x2goutils.h index 0ff2e8e..cc6bc38 100644 --- a/src/x2goutils.h +++ b/src/x2goutils.h @@ -22,6 +22,7 @@ #include <QString> QString expandHome( QString path ); +QString fixup_resources (const QString res_path); QString wrap_legacy_resources (const QString res_path); #endif -- Alioth's /srv/git/_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch feature/cleanup in repository x2goclient. commit 5a8ddcbe780066c454a3db2766b2d057e369eafd Author: Mihai Moldovan <ionic@ionic.de> Date: Sat Feb 14 23:59:10 2015 +0100 x2goutils: rename fixup_resources() and wrap_legacy_resources() to fixup_resource_URIs() and wrap_legacy_resource_URIs(). Update references in onmainwindow.cpp and sessionbutton.cpp. --- debian/changelog | 3 +++ src/onmainwindow.cpp | 7 +++---- src/sessionbutton.cpp | 7 +++---- src/x2goutils.cpp | 6 +++--- src/x2goutils.h | 4 ++-- 5 files changed, 14 insertions(+), 13 deletions(-) diff --git a/debian/changelog b/debian/changelog index 9233265..93d6cab 100644 --- a/debian/changelog +++ b/debian/changelog @@ -198,6 +198,9 @@ x2goclient (4.0.3.2-0x2go1) UNRELEASED; urgency=medium - Add myself to copyright section in the x2goutils headers. - Change four spaces per indentation level to two spaces in x2goutils.cpp. - Add fixup_resources() to x2goutils to fix "broken" resource URI's. + - Rename fixup_resources() and wrap_legacy_resources() to + fixup_resource_URIs() and wrap_legacy_resource_URIs(). Update + references. -- Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Thu, 27 Nov 2014 12:01:43 +0100 diff --git a/src/onmainwindow.cpp b/src/onmainwindow.cpp index cff4936..3f10fc9 100644 --- a/src/onmainwindow.cpp +++ b/src/onmainwindow.cpp @@ -2533,10 +2533,9 @@ void ONMainWindow::slotSelectedFromList ( SessionButton* session ) - sessIcon = wrap_legacy_resources (st->setting()->value ( - sid+"/icon", - (QVariant) ":/img/icons/128x128/x2gosession.png" - ).toString ()); + sessIcon = wrap_legacy_resource_URIs (st->setting()->value (sid+"/icon", + (QVariant) ":/img/icons/128x128/x2gosession.png" + ).toString ()); sessIcon = expandHome(sessIcon); command=st->setting()->value ( diff --git a/src/sessionbutton.cpp b/src/sessionbutton.cpp index 5690323..75d676f 100644 --- a/src/sessionbutton.cpp +++ b/src/sessionbutton.cpp @@ -310,10 +310,9 @@ void SessionButton::redraw() sessStatus->setText("("+tr("suspended")+")"); } - QString sessIcon = wrap_legacy_resources (st->setting()->value (sid+"/icon", - (QVariant) - ":/img/icons/128x128/x2gosession.png" - ).toString ()); + QString sessIcon = wrap_legacy_resource_URIs (st->setting()->value (sid+"/icon", + (QVariant) ":/img/icons/128x128/x2gosession.png" + ).toString ()); sessIcon = expandHome(sessIcon); QPixmap* pix; diff --git a/src/x2goutils.cpp b/src/x2goutils.cpp index a41fdf2..61d8d5c 100644 --- a/src/x2goutils.cpp +++ b/src/x2goutils.cpp @@ -30,7 +30,7 @@ QString expandHome( QString path ) return path; } -QString fixup_resources (const QString res_path) { +QString fixup_resource_URIs (const QString res_path) { QString ret (res_path); if (!(res_path.isEmpty ())) { @@ -42,7 +42,7 @@ QString fixup_resources (const QString res_path) { return (ret); } -QString wrap_legacy_resources (const QString res_path) { +QString wrap_legacy_resource_URIs (const QString res_path) { QString ret (res_path); if (!(res_path.isEmpty ())) { @@ -51,7 +51,7 @@ QString wrap_legacy_resources (const QString res_path) { legacy_locations.push_back (QString (":/png/")); legacy_locations.push_back (QString (":/svg/")); - ret = fixup_resources (ret); + ret = fixup_resource_URIs (ret); bool detected = false; diff --git a/src/x2goutils.h b/src/x2goutils.h index cc6bc38..912ce2d 100644 --- a/src/x2goutils.h +++ b/src/x2goutils.h @@ -22,7 +22,7 @@ #include <QString> QString expandHome( QString path ); -QString fixup_resources (const QString res_path); -QString wrap_legacy_resources (const QString res_path); +QString fixup_resource_URIs (const QString res_path); +QString wrap_legacy_resource_URIs (const QString res_path); #endif -- Alioth's /srv/git/_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git