UniversalIndentGUI 1.2.0
UiGuiVersion.cpp
Go to the documentation of this file.
00001 /***************************************************************************
00002  *   Copyright (C) 2006-2012 by Thomas Schweitzer                          *
00003  *   thomas-schweitzer(at)arcor.de                                         *
00004  *                                                                         *
00005  *   This program is free software; you can redistribute it and/or modify  *
00006  *   it under the terms of the GNU General Public License version 2.0 as   *
00007  *   published by the Free Software Foundation.                            *
00008  *                                                                         *
00009  *   This program is distributed in the hope that it will be useful,       *
00010  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00011  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00012  *   GNU General Public License for more details.                          *
00013  *                                                                         *
00014  *   You should have received a copy of the GNU General Public License     *
00015  *   along with this program in the file LICENSE.GPL; if not, write to the *
00016  *   Free Software Foundation, Inc.,                                       *
00017  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
00018  ***************************************************************************/
00019 
00020 #include "UiGuiVersion.h"
00021 
00022 #include <QString>
00023 #include <QStringList>
00024 #include <QDate>
00025 
00026 namespace UiGuiVersion {
00031 QString getBuildDate() {
00032     QStringList monthNames;
00033     QString buildDateString = "";
00034 
00035     monthNames << "Jan" << "Feb" << "Mar" << "Apr" << "May" << "Jun" << "Jul" << "Aug" << "Sep" << "Oct" << "Nov" << "Dez";
00036     QStringList buildDateStringList = QString(__DATE__).simplified().split(' '); // __DATE__ returns eg "Feb  4 2009"
00037 
00038     if ( buildDateStringList.count() == 3 ) {
00039         QDate buildDate(buildDateStringList.last().toInt(), monthNames.indexOf( buildDateStringList.first() )+1, buildDateStringList.at(1).toInt());
00040         buildDateString = buildDate.toString("d. MMMM yyyy");
00041     }
00042 
00043     return buildDateString;
00044 }
00045 
00046 
00051 QString getBuildRevision() {
00052     QString buildRevision = "";
00053     QStringList buildRevisionStringList = QString(PROGRAM_REVISION).simplified().split(' ');
00054 
00055     if ( buildRevisionStringList.count() == 3 ) {
00056         buildRevision = buildRevisionStringList.at(1);  // PROGRAM_REVISION is eg "$Revision: 907 $"
00057     }
00058 
00059     return buildRevision;
00060 }
00061 }  // namespace UiGuiVersion
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines