From eef31ea805e05d24185b89a8ab76b7f333ae1b3c Mon Sep 17 00:00:00 2001 From: joss17 Date: Thu, 13 Aug 2009 15:11:08 +0000 Subject: [PATCH] Revert "now retrieve version for gui directly from lib" This reverts commit 0aa0d500c001730e05ffecd69cf3068d87138557. The GUI and LIB could have two different version when compiling, so we need to keep both version info. Conflicts: retroshare-gui/src/version_detail.sh git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@1531 b45a01b8-16f6-495d-af2f-9b41ad6348cc --- retroshare-gui/src/RetroShare.pro | 10 ++++++++++ retroshare-gui/src/gui/MainWindow.cpp | 15 ++++---------- retroshare-gui/src/util/rsversion.cpp | 26 +++++++++++++++++++++++++ retroshare-gui/src/util/rsversion.h | 28 +++++++++++++++++++++++++++ 4 files changed, 68 insertions(+), 11 deletions(-) create mode 100644 retroshare-gui/src/util/rsversion.cpp create mode 100644 retroshare-gui/src/util/rsversion.h 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(); +