diff --git a/retroshare-gui/src/RetroShare.pro b/retroshare-gui/src/RetroShare.pro index 8dfccf193..95645acce 100644 --- a/retroshare-gui/src/RetroShare.pro +++ b/retroshare-gui/src/RetroShare.pro @@ -13,12 +13,20 @@ MOC_DIR = temp/moc linux-g++ { OBJECTS_DIR = temp/linux-g++/obj QMAKE_LFLAGS += -L"../../../../lib/linux-g++" + CONFIG += version_detail_bash_script } linux-g++-64 { OBJECTS_DIR = temp/linux-g++-64/obj QMAKE_LFLAGS += -L"../../../../lib/linux-g++-64" + CONFIG += version_detail_bash_script } +version_detail_bash_script { + DEFINES += ADD_LIBRETROSHARE_VERSION_INFO + QMAKE_EXTRA_TARGETS += write_version_detail + PRE_TARGETDEPS = write_version_detail + write_version_detail.commands = ./version_detail.sh +} #################### Cross compilation for windows under Linux ################### win32-x-g++ { @@ -163,6 +171,7 @@ HEADERS += rshare.h \ util/MouseEventFilter.h \ util/EventFilter.h \ util/Widget.h \ + util/rsversion.h \ util/RsAction.h \ util/printpreview.h \ util/log.h \ @@ -380,6 +389,7 @@ SOURCES += main.cpp \ util/EventFilter.cpp \ util/Widget.cpp \ util/RsAction.cpp \ + util/rsversion.cpp \ util/printpreview.cpp \ util/log.cpp \ gui/bwgraph/bwgraph.cpp \ diff --git a/retroshare-gui/src/gui/MainWindow.cpp b/retroshare-gui/src/gui/MainWindow.cpp index 33ed2dce1..7c2b8a416 100644 --- a/retroshare-gui/src/gui/MainWindow.cpp +++ b/retroshare-gui/src/gui/MainWindow.cpp @@ -61,9 +61,9 @@ #include "rsiface/rsiface.h" #include "rsiface/rspeers.h" #include "rsiface/rsfiles.h" -#include "rsiface/rsdisc.h" #include "gui/connect/ConnectFriendWizard.h" +#include "util/rsversion.h" #include #include @@ -123,14 +123,7 @@ MainWindow::MainWindow(QWidget* parent, Qt::WFlags flags) /* Create RshareSettings object */ _settings = new RshareSettings(); - QString version = "-"; - std::map::iterator vit; - std::map versions; - bool retv = rsDisc->getDiscVersions(versions); - if (retv && versions.end() != (vit = versions.find(rsPeers->getOwnId()))) { - version = QString::fromStdString(vit->second); - } - setWindowTitle(tr("RetroShare %1 a secure decentralised commmunication platform").arg(version)); + setWindowTitle(tr("RetroShare %1 a secure decentralised commmunication platform").arg(retroshareVersion())); // Setting icons this->setWindowIcon(QIcon(QString::fromUtf8(":/images/rstray3.png"))); @@ -523,8 +516,8 @@ void MainWindow::createActions() */ void MainWindow::doQuit() { - - if(!_settings->value(QString::fromUtf8("doQuit"), false).toBool()) + + if(!_settings->value(QString::fromUtf8("doQuit"), false).toBool()) { QString queryWrn; queryWrn.clear(); diff --git a/retroshare-gui/src/util/rsversion.cpp b/retroshare-gui/src/util/rsversion.cpp new file mode 100644 index 000000000..d1c661b0c --- /dev/null +++ b/retroshare-gui/src/util/rsversion.cpp @@ -0,0 +1,26 @@ +/**************************************************************** + * RetroShare is distributed under the following license: + * + * Copyright (C) 2006,2007 crypton + * + * 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 the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + ****************************************************************/ + +#include "rsversion.h" + +QString retroshareVersion() { + return QString(GUI_VERSION); +} diff --git a/retroshare-gui/src/util/rsversion.h b/retroshare-gui/src/util/rsversion.h new file mode 100644 index 000000000..725855cd1 --- /dev/null +++ b/retroshare-gui/src/util/rsversion.h @@ -0,0 +1,28 @@ +/**************************************************************** + * RetroShare is distributed under the following license: + * + * Copyright (C) 2006,2007 crypton + * + * 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 the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + ****************************************************************/ + + +#define GUI_VERSION "Revision: 1498 date : 10:34:44 08.04.09" + +#include + +QString retroshareVersion(); +