From e2ac4479b1717e83717ae1e475f6d36b98866b82 Mon Sep 17 00:00:00 2001 From: Vadim Kurland Date: Sun, 30 May 2010 19:22:36 +0000 Subject: [PATCH] added build signature reporting --- build_num | 2 +- qmake.inc.in | 5 +++++ src/gui/HttpGet.cpp | 22 ++++++++++------------ src/gui/global.h | 1 + src/gui/main.cpp | 2 +- 5 files changed, 18 insertions(+), 14 deletions(-) diff --git a/build_num b/build_num index 0f3480865..02f77b2d0 100644 --- a/build_num +++ b/build_num @@ -1 +1 @@ -#define BUILD_NUM 2938 +#define BUILD_NUM 2939 diff --git a/qmake.inc.in b/qmake.inc.in index 8620d4140..4ae4eedb6 100644 --- a/qmake.inc.in +++ b/qmake.inc.in @@ -70,6 +70,7 @@ unix { QMAKE_CFLAGS_RELEASE += -Wno-unused-parameter QMAKE_CXXFLAGS_DEBUG += -Wno-unused-parameter QMAKE_CXXFLAGS_RELEASE += -Wno-unused-parameter + } } @@ -77,6 +78,10 @@ win32 { CONFIG -= debug } +FWB_SIG = $$(FWB_SIG) +if (isEmpty(FWB_SIG)) { FWB_SIG=26932 } +DEFINES += FWB_SIG=$$FWB_SIG + exists(qmake2.inc) { include(qmake2.inc) } diff --git a/src/gui/HttpGet.cpp b/src/gui/HttpGet.cpp index a85ab21d9..a60859319 100644 --- a/src/gui/HttpGet.cpp +++ b/src/gui/HttpGet.cpp @@ -102,26 +102,24 @@ bool HttpGet::get(const QUrl &_url) QString locale = QLocale::system().name();//"en_US";// - QString agent = QString("fwbuilder/%1 (").arg(VERSION); - + QString os; #if defined(Q_WS_MAC) - agent += "MacOSX; "; + os = "MacOSX"; #else #if defined(Q_WS_WIN) - agent += "Windows; "; + os= "Windows"; #else - agent += QString("%1; %2; ").arg(OS).arg(DISTRO); + os = QString("%1; %2").arg(OS).arg(DISTRO); #endif #endif - agent += locale; - agent += QString("; b:%1; ").arg(build_num); + + QString reg = "u"; #ifdef ELC - if (getRegistrationStatus()==2) agent += "r"; - else agent += "u"; -#else - agent += "u"; + if (getRegistrationStatus()==2) reg = "r"; #endif - agent += ")"; + + QString agent = QString("fwbuilder/%1 (%2; %3; b:%4; s:%5; %6)") + .arg(VERSION).arg(os).arg(locale).arg(build_num).arg(sig).arg(reg); hdr.setValue("User-Agent", agent); request_id = http.request(hdr, NULL, &strm); diff --git a/src/gui/global.h b/src/gui/global.h index 4f6cacf5a..2cea58a42 100644 --- a/src/gui/global.h +++ b/src/gui/global.h @@ -54,6 +54,7 @@ extern std::string ee; extern int fwbdebug; extern QString build_num; extern QString user_name; +extern int sig; #ifdef NDEBUG diff --git a/src/gui/main.cpp b/src/gui/main.cpp index 3c53c0412..f26e2b9c6 100644 --- a/src/gui/main.cpp +++ b/src/gui/main.cpp @@ -97,7 +97,7 @@ int fwbdebug = 0; bool safemode = false; bool cli_print = false; QString cli_print_fwname = ""; - +int sig = FWB_SIG; void usage() {