diff options
Diffstat (limited to 'src/UiGuiVersion.cpp')
-rw-r--r-- | src/UiGuiVersion.cpp | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/src/UiGuiVersion.cpp b/src/UiGuiVersion.cpp index 4246644..c996ff5 100644 --- a/src/UiGuiVersion.cpp +++ b/src/UiGuiVersion.cpp @@ -19,9 +19,9 @@ #include "UiGuiVersion.h" -#include <tntqstring.h> -#include <tntqstringlist.h> -#include <tqdate.h> +#include <tqstring.h> +#include <tqstringlist.h> +#include <tqdatetime.h> namespace UiGuiVersion { @@ -32,19 +32,17 @@ namespace UiGuiVersion TQString getBuildDate() { TQStringList monthNames; - TQString buildDateString = ""; - - monthNames << "Jan" << "Feb" << "Mar" << "Apr" << "May" << "Jun" << "Jul" << "Aug" << "Sep" << - "Oct" << "Nov" << "Dez"; - TQStringList buildDateStringList = TQString(__DATE__).simplified().split(' '); // __DATE__ - // returns eg - // "Feb 4 2009" + monthNames << "Jan" << "Feb" << "Mar" << "Apr" << "May" << "Jun" + << "Jul" << "Aug" << "Sep" << "Oct" << "Nov" << "Dec"; + TQString buildDateString = ""; + // __DATE__ returns a string like "Feb 4 2009" + TQStringList buildDateStringList = TQStringList::split(' ', TQString(__DATE__).simplifyWhiteSpace()); if (buildDateStringList.count() == 3) { TQDate buildDate(buildDateStringList.last().toInt(), - monthNames.indexOf(buildDateStringList.first()) + 1, - buildDateStringList.at(1).toInt()); + monthNames.findIndex(buildDateStringList.first()) + 1, + buildDateStringList.at(1)->toInt()); buildDateString = buildDate.toString("d. MMMM yyyy"); } @@ -58,13 +56,13 @@ namespace UiGuiVersion TQString getBuildRevision() { TQString buildRevision = ""; - TQStringList buildRevisionStringList = TQString(PROGRAM_REVISION).simplified().split(' '); + TQStringList buildRevisionStringList = TQStringList::split(' ', TQString(PROGRAM_REVISION).simplifyWhiteSpace()); if (buildRevisionStringList.count() == 3) { - buildRevision = buildRevisionStringList.at(1); // PROGRAM_REVISION is eg "$Revision: 907 $" + buildRevision = *buildRevisionStringList.at(1); // PROGRAM_REVISION is eg "$Revision: 907 $" } return buildRevision; } -} // namespace UiGuiVersion +} |