summaryrefslogtreecommitdiffstats
path: root/src/UiGuiVersion.cpp
diff options
context:
space:
mode:
authorMichele Calgaro <michele.calgaro@yahoo.it>2022-08-14 12:53:21 +0900
committerMichele Calgaro <michele.calgaro@yahoo.it>2022-08-14 12:53:21 +0900
commit2ba166d1f8deb93cbd10f0e397c31c531de63189 (patch)
tree3e391cd8dee07ce0b1bc010c99b3a87da8750900 /src/UiGuiVersion.cpp
parent509cd0aa505df0a93702608575b72f07a97c0139 (diff)
downloaduniversal-indent-gui-tqt-2ba166d1f8deb93cbd10f0e397c31c531de63189.tar.gz
universal-indent-gui-tqt-2ba166d1f8deb93cbd10f0e397c31c531de63189.zip
Fixed UiGuiVersion and argument parsing
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
Diffstat (limited to 'src/UiGuiVersion.cpp')
-rw-r--r--src/UiGuiVersion.cpp28
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
+}