diff --git a/retroshare-gui/src/RetroShare.pro b/retroshare-gui/src/RetroShare.pro index 87d2b7855..146880312 100644 --- a/retroshare-gui/src/RetroShare.pro +++ b/retroshare-gui/src/RetroShare.pro @@ -13,20 +13,12 @@ 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++ { @@ -171,7 +163,6 @@ HEADERS += rshare.h \ util/MouseEventFilter.h \ util/EventFilter.h \ util/Widget.h \ - util/rsversion.h \ util/RsAction.h \ util/printpreview.h \ util/log.h \ @@ -389,7 +380,6 @@ 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 c762204a5..4245e5183 100644 --- a/retroshare-gui/src/gui/MainWindow.cpp +++ b/retroshare-gui/src/gui/MainWindow.cpp @@ -64,9 +64,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 @@ -130,7 +130,14 @@ MainWindow::MainWindow(QWidget* parent, Qt::WFlags flags) /* Create RshareSettings object */ _settings = new RshareSettings(); - setWindowTitle(tr("RetroShare %1 a secure decentralised commmunication platform").arg(retroshareVersion())); + 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)); mSMPlayer = NULL; @@ -533,8 +540,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 deleted file mode 100644 index d1c661b0c..000000000 --- a/retroshare-gui/src/util/rsversion.cpp +++ /dev/null @@ -1,26 +0,0 @@ -/**************************************************************** - * 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 deleted file mode 100644 index 725855cd1..000000000 --- a/retroshare-gui/src/util/rsversion.h +++ /dev/null @@ -1,28 +0,0 @@ -/**************************************************************** - * 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(); - diff --git a/retroshare-gui/src/version_detail.sh b/retroshare-gui/src/version_detail.sh deleted file mode 100755 index 2642ce0c4..000000000 --- a/retroshare-gui/src/version_detail.sh +++ /dev/null @@ -1,47 +0,0 @@ -#!/bin/bash -#check if we're on *nix system -#write the version.html file -if (ls &> /dev/null); then - echo "Retroshare Gui version : " > gui/help/version.html - if ( /usr/bin/git log -n 1 &> /dev/null); then - #retrieve git information - echo "Git version : $(git status | grep branch | cut -c 3-) $(git log -n 1 | grep commit)" >> gui/help/version.html - fi - if ( /usr/bin/git log -n 1 | grep svn &> /dev/null); then - #retrieve git svn information - echo "Svn version : $(git log -n 1 | grep svn | awk '{print $2}' | head -1)" >> gui/help/version.html - elif ( /usr/bin/git log -n 10 | grep svn &> /dev/null); then - #retrieve git svn information - echo "Svn closest version : $(git log -n 10 | grep svn | awk '{print $2}' | head -1)" >> gui/help/version.html - fi - - if ( /usr/bin/svn info &> /dev/null); then - echo "Svn version : $(svn info | head -n 5 | tail -1)" >> gui/help/version.html - fi - date >> gui/help/version.html - echo "" >> gui/help/version.html - echo "" >> gui/help/version.html -fi - -#write the rsversion.h file -if ( git log -n 1 &> /dev/null); then - #retrieve git information - version="git : $(git status | grep branch | cut -c 6-) $(git log -n 1 | grep commit)" -fi - -if ( git log -n 1 | grep svn &> /dev/null); then - #retrieve git svn information - version="$version svn : $(git log -n 1 | grep svn | awk '{print $2}' | head -1 | sed 's/.*@//')" -elif ( git log -n 10 | grep svn &> /dev/null); then - #retrieve git svn information - version="$version svn closest version : $(git log -n 10 | grep svn | awk '{print $2}' | head -1 | sed 's/.*@//')" -fi - -if ( svn info &> /dev/null); then - version=$(svn info | head -n 5 | tail -1) -fi -if [[ $version != '' ]]; then - version="$version date : $(date +'%T %m.%d.%y')" - echo "Writing version to util/rsversion.h : $version " - sed -i "s/GUI_VERSION .*/GUI_VERSION \"$version\"/g" util/rsversion.h -fi