now retrieve version for gui directly from lib

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@1513 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
alexandrut 2009-08-10 21:25:16 +00:00
parent cb5f22a5c6
commit a78013b131
5 changed files with 11 additions and 115 deletions

View File

@ -13,20 +13,12 @@ MOC_DIR = temp/moc
linux-g++ { linux-g++ {
OBJECTS_DIR = temp/linux-g++/obj OBJECTS_DIR = temp/linux-g++/obj
QMAKE_LFLAGS += -L"../../../../lib/linux-g++" QMAKE_LFLAGS += -L"../../../../lib/linux-g++"
CONFIG += version_detail_bash_script
} }
linux-g++-64 { linux-g++-64 {
OBJECTS_DIR = temp/linux-g++-64/obj OBJECTS_DIR = temp/linux-g++-64/obj
QMAKE_LFLAGS += -L"../../../../lib/linux-g++-64" 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 ################### #################### Cross compilation for windows under Linux ###################
win32-x-g++ { win32-x-g++ {
@ -171,7 +163,6 @@ HEADERS += rshare.h \
util/MouseEventFilter.h \ util/MouseEventFilter.h \
util/EventFilter.h \ util/EventFilter.h \
util/Widget.h \ util/Widget.h \
util/rsversion.h \
util/RsAction.h \ util/RsAction.h \
util/printpreview.h \ util/printpreview.h \
util/log.h \ util/log.h \
@ -389,7 +380,6 @@ SOURCES += main.cpp \
util/EventFilter.cpp \ util/EventFilter.cpp \
util/Widget.cpp \ util/Widget.cpp \
util/RsAction.cpp \ util/RsAction.cpp \
util/rsversion.cpp \
util/printpreview.cpp \ util/printpreview.cpp \
util/log.cpp \ util/log.cpp \
gui/bwgraph/bwgraph.cpp \ gui/bwgraph/bwgraph.cpp \

View File

@ -64,9 +64,9 @@
#include "rsiface/rsiface.h" #include "rsiface/rsiface.h"
#include "rsiface/rspeers.h" #include "rsiface/rspeers.h"
#include "rsiface/rsfiles.h" #include "rsiface/rsfiles.h"
#include "rsiface/rsdisc.h"
#include "gui/connect/ConnectFriendWizard.h" #include "gui/connect/ConnectFriendWizard.h"
#include "util/rsversion.h"
#include <sstream> #include <sstream>
#include <iomanip> #include <iomanip>
@ -130,7 +130,14 @@ MainWindow::MainWindow(QWidget* parent, Qt::WFlags flags)
/* Create RshareSettings object */ /* Create RshareSettings object */
_settings = new RshareSettings(); _settings = new RshareSettings();
setWindowTitle(tr("RetroShare %1 a secure decentralised commmunication platform").arg(retroshareVersion())); QString version = "-";
std::map<std::string, std::string>::iterator vit;
std::map<std::string, std::string> 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; mSMPlayer = NULL;

View File

@ -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);
}

View File

@ -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>
QString retroshareVersion();

View File

@ -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