From 9be5a0ec75e41359a6820c1cf43193eaa1a22853 Mon Sep 17 00:00:00 2001 From: Konrad Rosenbaum Date: Thu, 22 Dec 2011 13:06:24 +0100 Subject: [PATCH] corrections for version info --- qtbase/include/interface.h | 2 +- woc/proc/processor.cpp | 14 +++++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/qtbase/include/interface.h b/qtbase/include/interface.h index f64aee8..f65d866 100644 --- a/qtbase/include/interface.h +++ b/qtbase/include/interface.h @@ -97,7 +97,7 @@ class WInterface:public QObject ///returns version info about the library QString libraryVersionInfo(WOb::VersionInfo)const; ///returns version info about the library - QString staticLibraryVersionInfo(WOb::VersionInfo); + static QString staticLibraryVersionInfo(WOb::VersionInfo); ///returns version info about the WOC that was used to generate the interface virtual QString wocVersionInfo(WOb::VersionInfo)const=0; ///returns version info about the interface itself diff --git a/woc/proc/processor.cpp b/woc/proc/processor.cpp index f2e5ac5..cb6658a 100644 --- a/woc/proc/processor.cpp +++ b/woc/proc/processor.cpp @@ -426,7 +426,9 @@ bool WocProcessor::callGit() if(lst.size()<2)continue; if(lst[0]=="commit")rev=lst[1];else if(lst[0]=="author"){ + //this contains the author, mail and commit time if(lst.size()<4)continue; + //get the time QString tz=lst[lst.size()-1]; date=lst[lst.size()-2]; QDateTime tm=QDateTime::fromTime_t(date.toLongLong()).toUTC(); @@ -438,8 +440,14 @@ bool WocProcessor::callGit() tz.mid(3,2).toInt(0,10)*60*f); }else tz=""; date=tm.toString("yyyy-MM-dd hh:mm:ss ")+tz; - m_verInfo.insert("Author",lst[1]); m_verInfo.insert("Time",date); + //get all components of the author + // remove "author" and time stamp + lst.takeFirst();lst.takeLast();lst.takeLast(); + // reassemble + QString auth; + foreach(QString s,lst)auth+=s+" "; + m_verInfo.insert("Author",auth.trimmed()); } } if(rev.isEmpty())rev=lrev; @@ -479,6 +487,10 @@ bool WocProcessor::callGit() path=tdir.dirName()+(path.isEmpty()?"":"/"+path); } }while(tdir.cdUp()); + //fallback URL for non-tracking branches + if(remurl.isEmpty()){ + m_verInfo.insert("RootURL",QUrl::fromLocalFile(tdir.absolutePath()).toString()); + } //modification state if(!procGit(gp+"status"+"-s"+".",res,tgt,m_gitExe))return false; int mctr=0; -- 1.7.2.5