Commit ceb33b0e authored by Christian Loose's avatar Christian Loose
Browse files

* Don't add a new line to the end of changelog

* Use QFile instead of FILE* and remove unneeded
   inheritance in cvsdir.cpp

svn path=/trunk/kdesdk/cervisia/; revision=192273
parent a51c43d5
2002-12-05 Christian Loose <christian.loose@hamburg.de>
* Don't add a new line to the end of changelog
* Use QFile instead of FILE* and remove unneeded
inheritance in cvsdir.cpp
2002-12-02 Christian Loose <christian.loose@hamburg.de>
* Fixed commit dialog bigger than screen bug (#50735)
......
......@@ -156,7 +156,7 @@ bool ChangeLogDialog::readFile(const QString &filename)
QString str = stream.readLine();
// preserve empty lines
if (str.isEmpty())
if (str.isEmpty() && !stream.eof())
str = "\n";
edit->append(str);
......
......@@ -23,7 +23,7 @@
#include "cvsdir.h"
class CvsIgnoreList : public QStrList
class CvsIgnoreList
{
public:
CvsIgnoreList(const QDir &dir);
......@@ -31,11 +31,13 @@ public:
void addEntriesFromString(const QString &str);
void addEntriesFromFile(const QString &name);
bool matches(QFileInfo *fi);
private:
QStrList ignoreList;
};
CvsIgnoreList::CvsIgnoreList(const QDir &dir)
: QStrList(true) // always make deep copies
{
static const char *ignorestr = ". .. core RCSLOG tags TAGS RCS SCCS .make.state\
.nse_depinfo #* .#* cvslog.* ,* CVS CVS.adm .del-* *.a *.olb *.o *.obj\
......@@ -57,27 +59,26 @@ void CvsIgnoreList::addEntriesFromString(const QString &str)
it != tokens.end(); ++it )
{
if ( *it == "!" )
clear();
ignoreList.clear();
else
append((*it).local8Bit());
ignoreList.append((*it).local8Bit());
}
}
void CvsIgnoreList::addEntriesFromFile(const QString &name)
{
char buf[512];
// FIXME: Use QFile
FILE *f = fopen(name.local8Bit(), "r");
if (!f)
return;
QFile file(name);
while (fgets(buf, sizeof buf, f))
{
QString line = buf;
addEntriesFromString(buf);
}
fclose(f);
if( file.open(IO_ReadOnly) )
{
QString line;
while( file.readLine(line, 512) != -1 )
addEntriesFromString(line);
file.close();
}
}
......@@ -87,7 +88,7 @@ bool CvsIgnoreList::matches(QFileInfo *fi)
// if (!fi->isFile())
// return false;
QStrListIterator it(*this);
QStrListIterator it(ignoreList);
for (; it.current(); ++it)
{
if (::fnmatch(it.current(), fi->fileName().local8Bit(), FNM_PATHNAME) == 0)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment