mirror of
https://github.com/fwbuilder/fwbuilder
synced 2026-03-21 10:47:16 +01:00
fixes in the code that determins appRootDir and fixes for sorting of RCS list
This commit is contained in:
parent
e44bd1cc72
commit
e2c23d1c96
@ -44,7 +44,7 @@
|
||||
#undef DISTRO
|
||||
|
||||
/* prefix dir */
|
||||
/* #undef PREFIX */
|
||||
#undef PREFIX
|
||||
|
||||
/* init dir */
|
||||
#undef RES_DIR
|
||||
|
||||
@ -57,10 +57,9 @@ string findExecutable(const char *argv0)
|
||||
* /proc/self/exec.
|
||||
*/
|
||||
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 "";
|
||||
return string(PREFIX) + FS_SEPARATOR + "bin";
|
||||
} else
|
||||
{
|
||||
// /proc/self/exec points at full path to the executable, including
|
||||
|
||||
@ -110,7 +110,7 @@ void Revision::operator=(const Revision &r)
|
||||
log = r.log ;
|
||||
}
|
||||
|
||||
bool Revision::operator<(const Revision &r)
|
||||
bool Revision::operator<(const Revision &r) const
|
||||
{
|
||||
for(int i=1; ; i++)
|
||||
{
|
||||
@ -127,12 +127,12 @@ bool Revision::operator<(const Revision &r)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Revision::operator==(const Revision &r)
|
||||
bool Revision::operator==(const Revision &r) const
|
||||
{
|
||||
return rev==r.rev;
|
||||
}
|
||||
|
||||
bool Revision::operator!=(const Revision &r)
|
||||
bool Revision::operator!=(const Revision &r) const
|
||||
{
|
||||
return rev!=r.rev;
|
||||
}
|
||||
@ -365,10 +365,15 @@ RCS::RCS(const QString &file)
|
||||
if (r.rev != "")
|
||||
{
|
||||
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
|
||||
for ()
|
||||
|
||||
@ -55,10 +55,9 @@ class Revision {
|
||||
Revision(const Revision &r);
|
||||
Revision(const QString &file, const QString &rev="");
|
||||
|
||||
bool operator<(const Revision &r);
|
||||
bool operator==(const Revision &r);
|
||||
bool operator!=(const Revision &r);
|
||||
|
||||
bool operator<(const Revision &r) const;
|
||||
bool operator==(const Revision &r) const;
|
||||
bool operator!=(const Revision &r) const;
|
||||
void operator=(const Revision &r);
|
||||
};
|
||||
|
||||
|
||||
@ -138,8 +138,9 @@ bool RCSFilePreview::showFileRLog( const QString &filename )
|
||||
}
|
||||
// addToRCS->setEnabled(false);
|
||||
|
||||
QTreeWidgetItem *rootItm=new QTreeWidgetItem( m_widget->RCSTreeView );
|
||||
rootItm->setText(0, filename.right( filename.length()-filename.lastIndexOf("/")-1 ) );
|
||||
QTreeWidgetItem *rootItm = new QTreeWidgetItem( m_widget->RCSTreeView );
|
||||
rootItm->setText(
|
||||
0, filename.right( filename.length()-filename.lastIndexOf("/")-1 ) );
|
||||
rootItm->setExpanded(true);
|
||||
|
||||
rcsComments.clear();
|
||||
@ -155,7 +156,7 @@ bool RCSFilePreview::showFileRLog( const QString &filename )
|
||||
|
||||
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( 1, (*i).date );
|
||||
itm->setText( 2, (*i).author );
|
||||
|
||||
@ -133,9 +133,5 @@ void join::operator()(string &s)
|
||||
|
||||
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;
|
||||
#endif
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user