1
0
mirror of https://github.com/fwbuilder/fwbuilder synced 2026-03-22 19:27:13 +01:00

fixes in the code that determins appRootDir and fixes for sorting of RCS list

This commit is contained in:
Vadim Kurland 2008-07-25 04:42:30 +00:00
parent e44bd1cc72
commit e2c23d1c96
7 changed files with 21 additions and 21 deletions

View File

@ -1 +1 @@
#define BUILD_NUM 408 #define BUILD_NUM 409

View File

@ -44,7 +44,7 @@
#undef DISTRO #undef DISTRO
/* prefix dir */ /* prefix dir */
/* #undef PREFIX */ #undef PREFIX
/* init dir */ /* init dir */
#undef RES_DIR #undef RES_DIR

View File

@ -57,10 +57,9 @@ string findExecutable(const char *argv0)
* /proc/self/exec. * /proc/self/exec.
*/ */
char buf[PATH_MAX]; char buf[PATH_MAX];
if ( readlink( "/proc/self/exec", buf, sizeof(buf) )<0 ) if ( readlink( "/proc/self/exe", buf, sizeof(buf) )<0 )
{ {
// Can do better: use a macro defined in configure via PREFIX return string(PREFIX) + FS_SEPARATOR + "bin";
return "";
} else } else
{ {
// /proc/self/exec points at full path to the executable, including // /proc/self/exec points at full path to the executable, including

View File

@ -110,7 +110,7 @@ void Revision::operator=(const Revision &r)
log = r.log ; log = r.log ;
} }
bool Revision::operator<(const Revision &r) bool Revision::operator<(const Revision &r) const
{ {
for(int i=1; ; i++) for(int i=1; ; i++)
{ {
@ -127,12 +127,12 @@ bool Revision::operator<(const Revision &r)
return true; return true;
} }
bool Revision::operator==(const Revision &r) bool Revision::operator==(const Revision &r) const
{ {
return rev==r.rev; return rev==r.rev;
} }
bool Revision::operator!=(const Revision &r) bool Revision::operator!=(const Revision &r) const
{ {
return rev!=r.rev; return rev!=r.rev;
} }
@ -365,10 +365,15 @@ RCS::RCS(const QString &file)
if (r.rev != "") if (r.rev != "")
{ {
revisions.push_back(r); revisions.push_back(r);
if (fwbdebug) qDebug("revision %s: '%s'",r.rev.toAscii().constData(),r.log.toAscii().constData()); if (fwbdebug)
qDebug("revision %s: '%s'",
r.rev.toAscii().constData(),
r.log.toAscii().constData());
} }
} }
// sort list revisions; its defined like this:
// QList<Revision> revisions
qSort(revisions);
#if 0 #if 0
for () for ()

View File

@ -55,10 +55,9 @@ class Revision {
Revision(const Revision &r); Revision(const Revision &r);
Revision(const QString &file, const QString &rev=""); Revision(const QString &file, const QString &rev="");
bool operator<(const Revision &r); bool operator<(const Revision &r) const;
bool operator==(const Revision &r); bool operator==(const Revision &r) const;
bool operator!=(const Revision &r); bool operator!=(const Revision &r) const;
void operator=(const Revision &r); void operator=(const Revision &r);
}; };

View File

@ -138,8 +138,9 @@ bool RCSFilePreview::showFileRLog( const QString &filename )
} }
// addToRCS->setEnabled(false); // addToRCS->setEnabled(false);
QTreeWidgetItem *rootItm=new QTreeWidgetItem( m_widget->RCSTreeView ); QTreeWidgetItem *rootItm = new QTreeWidgetItem( m_widget->RCSTreeView );
rootItm->setText(0, filename.right( filename.length()-filename.lastIndexOf("/")-1 ) ); rootItm->setText(
0, filename.right( filename.length()-filename.lastIndexOf("/")-1 ) );
rootItm->setExpanded(true); rootItm->setExpanded(true);
rcsComments.clear(); rcsComments.clear();
@ -155,7 +156,7 @@ bool RCSFilePreview::showFileRLog( const QString &filename )
if ((*i).rev.indexOf(QRegExp("^[0-9]+\\.[0-9]+$"))!=-1) if ((*i).rev.indexOf(QRegExp("^[0-9]+\\.[0-9]+$"))!=-1)
{ {
RCSViewItem *itm=new RCSViewItem( rootItm ); RCSViewItem *itm = new RCSViewItem( rootItm );
itm->setText( 0, (*i).rev ); itm->setText( 0, (*i).rev );
itm->setText( 1, (*i).date ); itm->setText( 1, (*i).date );
itm->setText( 2, (*i).author ); itm->setText( 2, (*i).author );

View File

@ -133,9 +133,5 @@ void join::operator()(string &s)
string getPathToBinary(const string &pgm_name) string getPathToBinary(const string &pgm_name)
{ {
#if defined(Q_OS_MACX)
return appRootDir + FS_SEPARATOR + "MacOS" + FS_SEPARATOR + pgm_name;
#else
return appRootDir + FS_SEPARATOR + pgm_name; return appRootDir + FS_SEPARATOR + pgm_name;
#endif
} }