This is an automated email from the git hooks/post-receive script. x2go pushed a change to branch master in repository x2goclient. from b2024e4 help.cpp: hardcode indentation value to 2 (for the first spaces) + maximum length of parameters + 4 (for the trailing 4 spaces). new 95f1ee1 x2goutils.{cpp,h}: implement new git_changelog_extract_commit_sha helper, extracting the most recent commit shasum from a git changelog string. new 6e89f0e help.cpp: use new git_changelog_extract_commit_sha() helper while building the help prelude. new a01b282 x2goutils.{cpp,h}: reformat only. The 3 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 | 5 +++++ src/help.cpp | 2 ++ src/x2goutils.cpp | 55 +++++++++++++++++++++++++++++++++++++++++++++-------- src/x2goutils.h | 9 +++++---- 4 files changed, 59 insertions(+), 12 deletions(-) -- Alioth's /srv/git/code.x2go.org/x2goclient.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 master in repository x2goclient. commit 95f1ee1e2299aa61f02dda591452fb2c3b1c96f3 Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Apr 23 04:07:55 2015 +0200 x2goutils.{cpp,h}: implement new git_changelog_extract_commit_sha helper, extracting the most recent commit shasum from a git changelog string. --- debian/changelog | 3 +++ src/x2goutils.cpp | 40 ++++++++++++++++++++++++++++++++++++++++ src/x2goutils.h | 1 + 3 files changed, 44 insertions(+) diff --git a/debian/changelog b/debian/changelog index 79c83c6..7aaf7f8 100644 --- a/debian/changelog +++ b/debian/changelog @@ -290,6 +290,9 @@ x2goclient (4.0.4.0-0x2go1) UNRELEASED; urgency=low maximum length of parameters + 4 (for the trailing 4 spaces). Calculations via terminal_cols and remaining do not work, if terminal_cols is unknown. + - x2goutils.{cpp,h}: implement new git_changelog_extract_commit_sha + helper, extracting the most recent commit shasum from a git changelog + string. [ Fernando Pedemonte ] * New upstream release (4.0.4.0): diff --git a/src/x2goutils.cpp b/src/x2goutils.cpp index 7f6eb5b..f07578e 100644 --- a/src/x2goutils.cpp +++ b/src/x2goutils.cpp @@ -23,6 +23,8 @@ #include <QMessageBox> #include "x2goutils.h" +#include "onmainwindow.h" +#include "x2gologdebug.h" QString expandHome( QString path ) { @@ -101,3 +103,41 @@ void show_RichText_WarningMsgBox (const QString& main_text, const QString& infor msg_box.setWindowModality (Qt::WindowModal); msg_box.exec (); } + +QString git_changelog_extract_commit_sha (const QString &gitlog) { + QString ret = ""; + + /* + * Do a poor man's split. + * We know that a newline character should be somewhere at the beginning of the string. + * We don't need to have Qt split the string up completely as we only care about + * a substring: from start to the first newline character. + */ + std::ptrdiff_t pos = gitlog.indexOf ("\n"); + + if (0 < pos) { + ret = gitlog.left (pos + 1); + + x2goDebug << "First line of git changelog: " << ret; + + pos = ret.lastIndexOf (")"); + + if (0 < pos) { + std::ptrdiff_t pos_paren_start = ret.lastIndexOf ("("); + + if ((0 < pos_paren_start) && (pos_paren_start < pos)) { + ret = ret.mid (pos_paren_start + 1, pos - pos_paren_start - 1); + } + else { + // Either starting parenthesis not found or starting parenthesis comes first. + ret = ""; + } + } + else { + // End parenthesis not found. + ret = ""; + } + } + + return (ret); +} diff --git a/src/x2goutils.h b/src/x2goutils.h index cf95b58..6b6f5d0 100644 --- a/src/x2goutils.h +++ b/src/x2goutils.h @@ -28,5 +28,6 @@ QString fixup_resource_URIs (const QString& res_path); QString wrap_legacy_resource_URIs (const QString& res_path); QString convert_to_rich_text (const QString &text, bool force = false); void show_RichText_WarningMsgBox (const QString& main_text, const QString& informative_text = ""); +QString git_changelog_extract_commit_sha (const QString &gitlog); #endif /* !defined (X2GOUTILS_H) */ -- Alioth's /srv/git/code.x2go.org/x2goclient.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 master in repository x2goclient. commit a01b28261ca3bbce539769978792eba1800be836 Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Apr 23 04:11:51 2015 +0200 x2goutils.{cpp,h}: reformat only. --- src/x2goutils.cpp | 15 +++++++-------- src/x2goutils.h | 8 ++++---- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/src/x2goutils.cpp b/src/x2goutils.cpp index f07578e..7bf3d00 100644 --- a/src/x2goutils.cpp +++ b/src/x2goutils.cpp @@ -26,16 +26,15 @@ #include "onmainwindow.h" #include "x2gologdebug.h" -QString expandHome( QString path ) -{ - path = path.trimmed(); - if ( path.startsWith("~/") || path.startsWith("~\\") ) { - path = path.replace(QString("~"), QDir::homePath()); +QString expandHome (QString path) { + path = path.trimmed (); + if (path.startsWith ("~/") || path.startsWith ("~\\")) { + path = path.replace (QString ("~"), QDir::homePath ()); } return path; } -QString fixup_resource_URIs (const QString& res_path) { +QString fixup_resource_URIs (const QString &res_path) { QString ret (res_path); if (!(res_path.isEmpty ())) { @@ -47,7 +46,7 @@ QString fixup_resource_URIs (const QString& res_path) { return (ret); } -QString wrap_legacy_resource_URIs (const QString& res_path) { +QString wrap_legacy_resource_URIs (const QString &res_path) { QString ret (res_path); if (!(res_path.isEmpty ())) { @@ -91,7 +90,7 @@ QString convert_to_rich_text (const QString &text, bool force) { return (fixup_text); } -void show_RichText_WarningMsgBox (const QString& main_text, const QString& informative_text) { +void show_RichText_WarningMsgBox (const QString &main_text, const QString &informative_text) { QString fixup_main_text (convert_to_rich_text (main_text)); QString fixup_informative_text (convert_to_rich_text (informative_text, true)); diff --git a/src/x2goutils.h b/src/x2goutils.h index 6b6f5d0..d87a997 100644 --- a/src/x2goutils.h +++ b/src/x2goutils.h @@ -23,11 +23,11 @@ #define UNUSED(x) do { (void) x; } while (0) -QString expandHome( QString path ); -QString fixup_resource_URIs (const QString& res_path); -QString wrap_legacy_resource_URIs (const QString& res_path); +QString expandHome (QString path); +QString fixup_resource_URIs (const QString &res_path); +QString wrap_legacy_resource_URIs (const QString &res_path); QString convert_to_rich_text (const QString &text, bool force = false); -void show_RichText_WarningMsgBox (const QString& main_text, const QString& informative_text = ""); +void show_RichText_WarningMsgBox (const QString &main_text, const QString &informative_text = ""); QString git_changelog_extract_commit_sha (const QString &gitlog); #endif /* !defined (X2GOUTILS_H) */ -- Alioth's /srv/git/code.x2go.org/x2goclient.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 master in repository x2goclient. commit 6e89f0e4bbc850dcb23bfae2865446abae16abd9 Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Apr 23 04:10:15 2015 +0200 help.cpp: use new git_changelog_extract_commit_sha() helper while building the help prelude. --- debian/changelog | 2 ++ src/help.cpp | 2 ++ 2 files changed, 4 insertions(+) diff --git a/debian/changelog b/debian/changelog index 7aaf7f8..0488684 100644 --- a/debian/changelog +++ b/debian/changelog @@ -293,6 +293,8 @@ x2goclient (4.0.4.0-0x2go1) UNRELEASED; urgency=low - x2goutils.{cpp,h}: implement new git_changelog_extract_commit_sha helper, extracting the most recent commit shasum from a git changelog string. + - help.cpp: use new git_changelog_extract_commit_sha() helper while + building the help prelude. [ Fernando Pedemonte ] * New upstream release (4.0.4.0): diff --git a/src/help.cpp b/src/help.cpp index fb44394..718f18b 100644 --- a/src/help.cpp +++ b/src/help.cpp @@ -40,6 +40,7 @@ #include "version.h" #include "x2gologdebug.h" #include "onmainwindow.h" +#include "x2goutils.h" help::prelude_t help::cleanup_prelude (help::prelude_t prelude) { for (help::prelude_t::iterator it = prelude.begin (); it != prelude.end (); ++it) { @@ -72,6 +73,7 @@ help::prelude_t help::build_prelude () { QTextStream stream (&file); QString git_info (stream.readAll ().trimmed ()); + git_info = git_changelog_extract_commit_sha (git_info); if (!(git_info.isEmpty ())) { ver.append (" (Git information: " + git_info + ")"); -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git