corrections for version info
authorKonrad Rosenbaum <konrad@silmor.de>
Thu, 22 Dec 2011 12:06:24 +0000 (13:06 +0100)
committerKonrad Rosenbaum <konrad@silmor.de>
Thu, 22 Dec 2011 12:06:24 +0000 (13:06 +0100)
qtbase/include/interface.h
woc/proc/processor.cpp

index f64aee8..f65d866 100644 (file)
@@ -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
index f2e5ac5..cb6658a 100644 (file)
@@ -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;