diff --git a/kmacctexppop.cpp b/kmacctexppop.cpp index 24ccd09be..24187a3f7 100644 --- a/kmacctexppop.cpp +++ b/kmacctexppop.cpp @@ -67,9 +67,6 @@ KMAcctExpPop::KMAcctExpPop(KMAcctMgr* aOwner, const char* aAccountName): KIO::Scheduler::connect( SIGNAL(slaveError(KIO::Slave *, int, const QString &)), this, SLOT(slotSlaveError(KIO::Slave *, int, const QString &))); - KIO::Scheduler::connect( - SIGNAL(slaveConnected(KIO::Slave *)), - this, SLOT(slotSlaveConnected(KIO::Slave *))); } @@ -567,7 +564,6 @@ void KMAcctExpPop::startJob() { } else if (mAuth != "AUTO") mSlaveConfig.insert("auth", mAuth); slave = KIO::Scheduler::getConnectedSlave( url.url(), mSlaveConfig ); -// This can't go here. It has to go in slotSlaveConnected() url.setPath(QString("/index")); job = KIO::get( url.url(), false, false ); connectJob(); @@ -823,14 +819,3 @@ void KMAcctExpPop::slotSlaveError(KIO::Slave *aSlave, int error, stage = Quit; slotCancel(); } - -void KMAcctExpPop::slotSlaveConnected(KIO::Slave *aSlave) -{ -#if 0 - if (aSlave != slave) return; - KURL url = getUrl(); - url.setPath(QString("/index")); - job = KIO::get( url.url(), false, false ); - connectJob(); -#endif -} diff --git a/kmacctexppop.h b/kmacctexppop.h index 1ec57f563..da94f2328 100644 --- a/kmacctexppop.h +++ b/kmacctexppop.h @@ -187,9 +187,6 @@ protected slots: /** Slave error handling */ void slotSlaveError(KIO::Slave *, int, const QString &); - - /** Start the transfer, when the connection is established */ - void slotSlaveConnected(KIO::Slave *); }; diff --git a/kmacctmgr.cpp b/kmacctmgr.cpp index 1634b7d99..7d34a812c 100644 --- a/kmacctmgr.cpp +++ b/kmacctmgr.cpp @@ -25,11 +25,9 @@ #include //----------------------------------------------------------------------------- -KMAcctMgr::KMAcctMgr(const char* aBasePath): KMAcctMgrInherited() +KMAcctMgr::KMAcctMgr(): KMAcctMgrInherited() { - assert(aBasePath != NULL); mAcctList.setAutoDelete(TRUE); - setBasePath(aBasePath); mAccountIt = new QListIterator(mAcctList); mAcctChecking = new QList(); checking = false; @@ -47,21 +45,6 @@ KMAcctMgr::~KMAcctMgr() } -//----------------------------------------------------------------------------- -void KMAcctMgr::setBasePath(const char* aBasePath) -{ - assert(aBasePath != NULL); - - if (aBasePath[0] == '~') - { - mBasePath = QDir::homeDirPath(); - mBasePath.append("/"); - mBasePath.append(aBasePath+1); - } - else mBasePath = aBasePath; -} - - //----------------------------------------------------------------------------- void KMAcctMgr::writeConfig(bool withSync) { diff --git a/kmacctmgr.h b/kmacctmgr.h index 2ad34164f..a7cc86552 100644 --- a/kmacctmgr.h +++ b/kmacctmgr.h @@ -24,16 +24,9 @@ class KMAcctMgr: public QObject public: /** Initialize Account Manager and load accounts with reload() if the base path is given */ - KMAcctMgr(const char* aBasePath); + KMAcctMgr(); virtual ~KMAcctMgr(); - /** Returns path to directory where the accounts' configuration is stored. */ - QString basePath(void) const { return mBasePath; } - - /** Set base path. Does *not* call reload(). A tilde (~) as the first - character is expanded to the contents of the HOME environment variable. */ - virtual void setBasePath(const char* aBasePath); - /** Completely reload accounts from config. */ virtual void readConfig(void); @@ -78,7 +71,6 @@ signals: void checkedMail(bool); private: - QString mBasePath; KMAcctList mAcctList; QListIterator< KMAccount > *mAccountIt; QList< KMAccount > *mAcctChecking; diff --git a/kmfilteraction.cpp b/kmfilteraction.cpp index 436e62d7b..a98f14dc9 100644 --- a/kmfilteraction.cpp +++ b/kmfilteraction.cpp @@ -558,8 +558,8 @@ public: virtual bool isEmpty() const { return false; } - virtual void KMFilterActionSetStatus::argsFromString( const QString argsStr ); - virtual const QString KMFilterActionSetStatus::argsAsString() const; + virtual void argsFromString( const QString argsStr ); + virtual const QString argsAsString() const; }; diff --git a/kmfolder.cpp b/kmfolder.cpp index a4094b4bc..acb7a7176 100644 --- a/kmfolder.cpp +++ b/kmfolder.cpp @@ -114,38 +114,38 @@ KMFolder :: ~KMFolder() //----------------------------------------------------------------------------- -QCString KMFolder::location() const +QString KMFolder::location() const { - QCString sLocation(path().local8Bit()); + QString sLocation(path()); if (!sLocation.isEmpty()) sLocation += '/'; - sLocation += name().local8Bit(); + sLocation += name(); return sLocation; } //----------------------------------------------------------------------------- -QCString KMFolder::indexLocation() const +QString KMFolder::indexLocation() const { - QCString sLocation(path().local8Bit()); + QString sLocation(path()); if (!sLocation.isEmpty()) sLocation += '/'; sLocation += '.'; - sLocation += name().local8Bit(); + sLocation += name(); sLocation += ".index"; return sLocation; } //----------------------------------------------------------------------------- -QCString KMFolder::subdirLocation() const +QString KMFolder::subdirLocation() const { - QCString sLocation(path().local8Bit()); + QString sLocation(path()); if (!sLocation.isEmpty()) sLocation += '/'; sLocation += '.'; - sLocation += name().local8Bit(); + sLocation += name(); sLocation += ".directory"; return sLocation; @@ -154,17 +154,18 @@ QCString KMFolder::subdirLocation() const //----------------------------------------------------------------------------- KMFolderDir* KMFolder::createChildFolder() { - QCString childName = "." + name().local8Bit() + ".directory"; - QCString childDir = path().local8Bit() + "/" + childName; + QString childName = "." + name() + ".directory"; + QString childDir = path() + "/" + childName; bool ok = true; if (mChild) return mChild; - if (access(childDir, W_OK) != 0) // Not there or not writable + if (access(childDir.local8Bit(), W_OK) != 0) // Not there or not writable { - if (mkdir(childDir, S_IRWXU) != 0 && chmod(childDir, S_IRWXU) != 0) - ok=false; //failed create new or chmod existing tmp/ + if (mkdir(childDir.local8Bit(), S_IRWXU) != 0 + && chmod(childDir.local8Bit(), S_IRWXU) != 0) + ok=false; //failed create new or chmod existing tmp/ } if (!ok) { @@ -173,8 +174,7 @@ KMFolderDir* KMFolder::createChildFolder() return 0; } - KMFolderDir* folderDir = new KMFolderDir(parent(), - QString::fromLocal8Bit(childName)); + KMFolderDir* folderDir = new KMFolderDir(parent(), childName); if (!folderDir) return 0; folderDir->reload(); @@ -194,10 +194,10 @@ int KMFolder::open() assert(name() != ""); mFilesLocked = FALSE; - mStream = fopen(location(), "r+"); // messages file + mStream = fopen(location().local8Bit(), "r+"); // messages file if (!mStream) { - kdDebug(5006) << "Cannot open folder `" << (const char*)location() << "': " << strerror(errno) << endl; + kdDebug(5006) << "Cannot open folder `" << location() << "': " << strerror(errno) << endl; mOpenCount = 0; return errno; } @@ -214,7 +214,7 @@ int KMFolder::open() .arg(name()); emit statusMsg(str); } else { - mIndexStream = fopen(indexLocation(), "r+"); // index file + mIndexStream = fopen(indexLocation().local8Bit(), "r+"); // index file updateIndexStreamPtr(); } @@ -246,7 +246,7 @@ int KMFolder::create() assert(mOpenCount == 0); kdDebug(5006) << "Creating folder " << endl; - if (access(location(), F_OK) == 0) { + if (access(location().local8Bit(), F_OK) == 0) { kdDebug(5006) << "KMFolder::create call to access function failed." << endl; kdDebug(5006) << "File:: " << endl; kdDebug(5006) << "Error " << endl; @@ -254,7 +254,7 @@ int KMFolder::create() } old_umask = umask(077); - mStream = fopen(location(), "w+"); //sven; open RW + mStream = fopen(location().local8Bit(), "w+"); //sven; open RW umask(old_umask); if (!mStream) return errno; @@ -262,7 +262,7 @@ int KMFolder::create() if (!path().isEmpty()) { old_umask = umask(077); - mIndexStream = fopen(indexLocation(), "w+"); //sven; open RW + mIndexStream = fopen(indexLocation().local8Bit(), "w+"); //sven; open RW updateIndexStreamPtr(TRUE); umask(old_umask); @@ -341,7 +341,7 @@ int KMFolder::lock() if (rc < 0) { - kdDebug(5006) << "Cannot lock folder `" << (const char*)location() << "': " + kdDebug(5006) << "Cannot lock folder `" << location() << "': " << strerror(errno) << " (" << errno << ")" << endl; return errno; } @@ -352,7 +352,7 @@ int KMFolder::lock() if (rc < 0) { - kdDebug(5006) << "Cannot lock index of folder `" << (const char*)location() << "': " + kdDebug(5006) << "Cannot lock index of folder `" << location() << "': " << strerror(errno) << " (" << errno << ")" << endl; rc = errno; fl.l_type = F_UNLCK; @@ -369,20 +369,20 @@ int KMFolder::lock() else cmd_str += location() + ".lock"; - rc = system( cmd_str.latin1() ); + rc = system( cmd_str.local8Bit() ); if( rc != 0 ) { - kdDebug(5006) << "Cannot lock folder `" << (const char*)location() << "': " + kdDebug(5006) << "Cannot lock folder `" << location() << "': " << strerror(rc) << " (" << rc << ")" << endl; return rc; } if( mIndexStream ) { cmd_str = "lockfile " + indexLocation() + ".lock"; - rc = system( cmd_str.latin1() ); + rc = system( cmd_str.local8Bit() ); if( rc != 0 ) { - kdDebug(5006) << "Cannot lock index of folder `" << (const char*)location() << "': " + kdDebug(5006) << "Cannot lock index of folder `" << location() << "': " << strerror(rc) << " (" << rc << ")" << endl; return rc; } @@ -391,20 +391,20 @@ int KMFolder::lock() case mutt_dotlock: cmd_str = "mutt_dotlock " + location(); - rc = system( cmd_str.latin1() ); + rc = system( cmd_str.local8Bit() ); if( rc != 0 ) { - kdDebug(5006) << "Cannot lock folder `" << (const char*)location() << "': " + kdDebug(5006) << "Cannot lock folder `" << location() << "': " << strerror(rc) << " (" << rc << ")" << endl; return rc; } if( mIndexStream ) { cmd_str = "mutt_dotlock " + indexLocation(); - rc = system( cmd_str.latin1() ); + rc = system( cmd_str.local8Bit() ); if( rc != 0 ) { - kdDebug(5006) << "Cannot lock index of folder `" << (const char*)location() << "': " + kdDebug(5006) << "Cannot lock index of folder `" << location() << "': " << strerror(rc) << " (" << rc << ")" << endl; return rc; } @@ -413,20 +413,20 @@ int KMFolder::lock() case mutt_dotlock_privileged: cmd_str = "mutt_dotlock -p " + location(); - rc = system( cmd_str.latin1() ); + rc = system( cmd_str.local8Bit() ); if( rc != 0 ) { - kdDebug(5006) << "Cannot lock folder `" << (const char*)location() << "': " + kdDebug(5006) << "Cannot lock folder `" << location() << "': " << strerror(rc) << " (" << rc << ")" << endl; return rc; } if( mIndexStream ) { cmd_str = "mutt_dotlock -p " + indexLocation(); - rc = system( cmd_str.latin1() ); + rc = system( cmd_str.local8Bit() ); if( rc != 0 ) { - kdDebug(5006) << "Cannot lock index of folder `" << (const char*)location() << "': " + kdDebug(5006) << "Cannot lock index of folder `" << location() << "': " << strerror(rc) << " (" << rc << ")" << endl; return rc; } @@ -721,7 +721,7 @@ int KMFolder::createIndexFromContents() //----------------------------------------------------------------------------- int KMFolder::writeIndex() { - QCString tempName; + QString tempName; KMMsgBase* msgBase; int old_umask; int i=0, len; @@ -730,11 +730,11 @@ int KMFolder::writeIndex() old_umask = umask(077); //the sorted file must be removed, BIG kludge, don made me do it! - unlink(indexLocation() + ".sorted"); + unlink(indexLocation().local8Bit() + ".sorted"); tempName = indexLocation() + ".temp"; - unlink(tempName); + unlink(tempName.local8Bit()); - FILE *tmpIndexStream = fopen(tempName, "w"); + FILE *tmpIndexStream = fopen(tempName.local8Bit(), "w"); umask(old_umask); if (!tmpIndexStream) return errno; @@ -762,11 +762,11 @@ int KMFolder::writeIndex() if (fflush(tmpIndexStream) != 0) return errno; if (fclose(tmpIndexStream) != 0) return errno; - _rename(tempName, indexLocation()); + _rename(tempName.local8Bit(), indexLocation().local8Bit()); if (mIndexStream) fclose(mIndexStream); mHeaderOffset = nho; - mIndexStream = fopen(indexLocation(), "r+"); // index file + mIndexStream = fopen(indexLocation().local8Bit(), "r+"); // index file updateIndexStreamPtr(); mDirty = FALSE; @@ -792,14 +792,14 @@ bool KMFolder::readIndexHeader(int *gv) *gv = indexVersion; if (indexVersion < 1505 ) { if(indexVersion == 1503) { - kdDebug(5006) << "Converting old index file " << (const char*)indexLocation() << " to utf-8" << endl; + kdDebug(5006) << "Converting old index file " << indexLocation() << " to utf-8" << endl; mConvertToUtf8 = TRUE; } return TRUE; } else if (indexVersion == 1505) { fseek(mIndexStream, sizeof(char), SEEK_CUR ); } else if (indexVersion < INDEX_VERSION) { - kdDebug(5006) << "Index file " << (const char*)indexLocation() << " is out of date. Re-creating it." << endl; + kdDebug(5006) << "Index file " << indexLocation() << " is out of date. Re-creating it." << endl; createIndexFromContents(); return FALSE; } else if(indexVersion > INDEX_VERSION) { @@ -1434,7 +1434,7 @@ int KMFolder::addMsg(KMMessage* aMsg, int* aIndex_ret, bool imapQuiet) kdDebug(5006) << "Error: Could not add message to folder (No space left on device?)" << endl; if (ftell(mStream) > revert) { kdDebug(5006) << "Undoing changes" << endl; - truncate( location(), revert ); + truncate( location().local8Bit(), revert ); } kdDebug(5006) << "Abnormally terminating to prevent data loss, now." << endl; exit(1); @@ -1496,7 +1496,7 @@ int KMFolder::addMsg(KMMessage* aMsg, int* aIndex_ret, bool imapQuiet) kdDebug(5006) << "Error: Could not add message to folder (No space left on device?)" << endl; if (ftell(mIndexStream) > revert) { kdDebug(5006) << "Undoing changes" << endl; - truncate( indexLocation(), revert ); + truncate( indexLocation().local8Bit(), revert ); } kdDebug(5006) << "Abnormally terminating to prevent data loss, now." << endl; exit(1); @@ -1533,8 +1533,8 @@ int KMFolder::addMsg(KMMessage* aMsg, int* aIndex_ret, bool imapQuiet) //----------------------------------------------------------------------------- int KMFolder::rename(const QString& aName, KMFolderDir *aParent) { - QCString oldLoc, oldIndexLoc, newLoc, newIndexLoc; - QCString oldSubDirLoc, newSubDirLoc; + QString oldLoc, oldIndexLoc, newLoc, newIndexLoc; + QString oldSubDirLoc, newSubDirLoc; QString oldName; int rc=0, openCount=mOpenCount; KMFolderDir *oldParent; @@ -1557,14 +1557,14 @@ int KMFolder::rename(const QString& aName, KMFolderDir *aParent) newIndexLoc = indexLocation(); newSubDirLoc = subdirLocation(); - if (_rename(oldLoc, newLoc)) { + if (_rename(oldLoc.local8Bit(), newLoc.local8Bit())) { setName(oldName); setParent(oldParent); rc = errno; } else if (!oldIndexLoc.isEmpty()) { - _rename(oldIndexLoc, newIndexLoc); - if (!_rename(oldSubDirLoc, newSubDirLoc )) { + _rename(oldIndexLoc.local8Bit(), newIndexLoc.local8Bit()); + if (!_rename(oldSubDirLoc.local8Bit(), newSubDirLoc.local8Bit() )) { KMFolderDir* fdir = parent(); KMFolderNode* fN; @@ -1605,8 +1605,9 @@ int KMFolder::remove() assert(name() != ""); close(TRUE); - unlink(indexLocation()); - rc = unlink(location()); + unlink(indexLocation().local8Bit() + ".sorted"); + unlink(indexLocation().local8Bit()); + rc = unlink(location().local8Bit()); if (rc) return rc; mMsgList.reset(INIT_MSGS); @@ -1624,10 +1625,10 @@ int KMFolder::expunge() close(TRUE); - if (mAutoCreateIndex) truncate(indexLocation(), mHeaderOffset); - else unlink(indexLocation()); + if (mAutoCreateIndex) truncate(indexLocation().local8Bit(), mHeaderOffset); + else unlink(indexLocation().local8Bit()); - if (truncate(location(), 0)) return errno; + if (truncate(location().local8Bit(), 0)) return errno; mDirty = FALSE; mMsgList.reset(INIT_MSGS); @@ -1654,7 +1655,7 @@ int KMFolder::expunge() //----------------------------------------------------------------------------- int KMFolder::compact() { - QCString tempName; + QString tempName; QString msgStr; int rc = 0; int openCount = mOpenCount; @@ -1663,9 +1664,9 @@ int KMFolder::compact() return 0; kdDebug(5006) << "Compacting " << endl; - tempName = path().local8Bit() + "/." + name().local8Bit() + ".compacted"; + tempName = path() + "/." + name() + ".compacted"; mode_t old_umask = umask(077); - FILE *tmpfile = fopen(tempName, "w"); + FILE *tmpfile = fopen(tempName.local8Bit(), "w"); umask(old_umask); if (!tmpfile) return errno; @@ -1741,7 +1742,7 @@ int KMFolder::compact() if (!rc) { writeIndex(); close(TRUE); - _rename(tempName, location()); + _rename(tempName.local8Bit(), location().local8Bit()); } else { diff --git a/kmfolder.h b/kmfolder.h index b88a37791..d8a55fe85 100644 --- a/kmfolder.h +++ b/kmfolder.h @@ -59,13 +59,13 @@ public: virtual ~KMFolder(); /** Returns full path to folder file */ - QCString location() const; + QString location() const; /** Returns full path to index file */ - QCString indexLocation() const; + QString indexLocation() const; /** Returns full path to sub directory file */ - QCString subdirLocation() const; + QString subdirLocation() const; /** Returns the folder directory associated with this node or 0 if no such directory exists */ diff --git a/kmfoldermgr.cpp b/kmfoldermgr.cpp index bab988268..c87b40d69 100644 --- a/kmfoldermgr.cpp +++ b/kmfoldermgr.cpp @@ -35,7 +35,6 @@ KMFolderMgr::KMFolderMgr(const QString& aBasePath): KMFolderMgrInherited(), mDir() { - setBasePath(aBasePath); } @@ -212,7 +211,7 @@ void KMFolderMgr::removeDirAux(KMFolderDir* aFolderDir) QDir dir; QString folderDirLocation = aFolderDir->path(); KMFolderNode* fN; - for (fN = aFolderDir->first(); fN != 0; fN = aFolderDir->next()) { + for (fN = aFolderDir->first(); fN != 0; fN = aFolderDir->first()) { if (fN->isDir()) removeDirAux(static_cast(fN)); else @@ -220,7 +219,7 @@ void KMFolderMgr::removeDirAux(KMFolderDir* aFolderDir) } aFolderDir->clear(); aFolderDir->parent()->remove(aFolderDir); - dir.remove(folderDirLocation); + dir.rmdir(folderDirLocation); } //----------------------------------------------------------------------------- @@ -261,7 +260,7 @@ void KMFolderMgr::createFolderList(QStringList *str, QValueList > *folders, KMFolderDir *adir, const QString& prefix, - bool i18nized=FALSE) + bool i18nized) { KMFolderNode* cur; KMFolderDir* fdir = adir ? adir : &(kernel->folderMgr()->dir()); diff --git a/kmheaders.cpp b/kmheaders.cpp index 4758dd941..364fd4cbc 100644 --- a/kmheaders.cpp +++ b/kmheaders.cpp @@ -2470,8 +2470,8 @@ void KMHeaders::setNestedOverride( bool override ) mSortInfo.dirty = TRUE; mNestedOverride = override; setRootIsDecorated( nestingPolicy != 0 && mNested != mNestedOverride ); - QCString sortFile = mFolder->indexLocation() + ".sorted"; - unlink(sortFile); + QString sortFile = mFolder->indexLocation() + ".sorted"; + unlink(sortFile.local8Bit()); reset(); } @@ -2545,18 +2545,18 @@ bool KMHeaders::writeSortOrder() { if (mSortInfo.removed) return TRUE; // Need serial ids to optimize this out - QCString sortFile = KMAIL_SORT_FILE(mFolder); + QString sortFile = KMAIL_SORT_FILE(mFolder); if (!mSortInfo.dirty) { struct stat stat_tmp; - if(stat(sortFile, &stat_tmp) == -1) { + if(stat(sortFile.local8Bit(), &stat_tmp) == -1) { mSortInfo.dirty = TRUE; } } if (mSortInfo.dirty) { - QCString tempName = sortFile + ".temp"; - unlink(tempName); - FILE *sortStream = fopen(tempName, "w"); + QString tempName = sortFile + ".temp"; + unlink(tempName.local8Bit()); + FILE *sortStream = fopen(tempName.local8Bit(), "w"); if (!sortStream) return FALSE; mSortInfo.dirty = FALSE; @@ -2629,14 +2629,14 @@ bool KMHeaders::writeSortOrder() fwrite(&sorted_count, sizeof(sorted_count), 1, sortStream); if (sortStream && ferror(sortStream)) { fclose(sortStream); - unlink(sortFile); + unlink(sortFile.local8Bit()); kdDebug(5006) << "Error: Failure modifying " << sortFile << " (No space left on device?)" << endl; kdDebug(5006) << "Abnormally terminating to prevent data loss, now." << endl; kdDebug(5006) << __FILE__ << ":" << __LINE__ << endl; exit(1); } fclose(sortStream); - rename(tempName, sortFile); + rename(tempName.local8Bit(), sortFile.local8Bit()); } return TRUE; @@ -2645,8 +2645,8 @@ bool KMHeaders::writeSortOrder() void KMHeaders::appendUnsortedItem(KMHeaderItem *khi) { - QCString sortFile = KMAIL_SORT_FILE(mFolder); - if(FILE *sortStream = fopen(sortFile, "r+")) { + QString sortFile = KMAIL_SORT_FILE(mFolder); + if(FILE *sortStream = fopen(sortFile.local8Bit(), "r+")) { KMMsgBase *kmb = mFolder->getMsgBase( khi->mMsgId ); int parent_id = -2; //no parent, top level if(khi->parent()) @@ -2663,7 +2663,7 @@ void KMHeaders::appendUnsortedItem(KMHeaderItem *khi) if (sortStream && ferror(sortStream)) { fclose(sortStream); - unlink(sortFile); + unlink(sortFile.local8Bit()); kdDebug(5006) << "Error: Failure modifying " << sortFile << " (No space left on device?)" << endl; kdDebug(5006) << "Abnormally terminating to prevent data loss, now." << endl; kdDebug(5006) << __FILE__ << ":" << __LINE__ << endl; @@ -2791,8 +2791,8 @@ bool KMHeaders::readSortOrder(bool set_selection) mItems[i] = 0; } - QCString sortFile = KMAIL_SORT_FILE(mFolder); - FILE *sortStream = fopen(sortFile, "r+"); + QString sortFile = KMAIL_SORT_FILE(mFolder); + FILE *sortStream = fopen(sortFile.local8Bit(), "r+"); mSortInfo.fakeSort = 0; if(sortStream) { @@ -3046,7 +3046,7 @@ bool KMHeaders::readSortOrder(bool set_selection) SHOW_TIMER(selection); if (sortStream && ferror(sortStream)) { fclose(sortStream); - unlink(sortFile); + unlink(sortFile.local8Bit()); kdDebug(5006) << "Error: Failure modifying " << sortFile << " (No space left on device?)" << endl; kdDebug(5006) << "Abnormally terminating to prevent data loss, now." << endl; kdDebug(5006) << __FILE__ << ":" << __LINE__ << endl; diff --git a/kmkernel.cpp b/kmkernel.cpp index d6d76ac63..1996b0159 100644 --- a/kmkernel.cpp +++ b/kmkernel.cpp @@ -442,7 +442,7 @@ void KMKernel::initFolders(KConfig* cfg) void KMKernel::init() { kdDebug(5006) << "entering KMKernel::init()" << endl; - QCString acctPath, foldersPath; + QString foldersPath; KConfig* cfg; the_checkingMail = false; @@ -460,19 +460,17 @@ void KMKernel::init() the_firstStart = cfg->readBoolEntry("first-start", true); the_previousVersion = cfg->readEntry("previous-version", ""); cfg->writeEntry("previous-version", KMAIL_VERSION); - foldersPath = cfg->readEntry("folders", "").local8Bit(); - acctPath = cfg->readEntry("accounts", foldersPath + "/.kmail-accounts") - .local8Bit(); + foldersPath = cfg->readEntry("folders", ""); if (foldersPath.isEmpty()) { - foldersPath = QString(QDir::homeDirPath() + QString("/Mail")).local8Bit(); + foldersPath = QDir::homeDirPath() + QString("/Mail"); transferMail(); } the_undoStack = new KMUndoStack(20); the_folderMgr = new KMFolderMgr(foldersPath); - the_acctMgr = new KMAcctMgr(acctPath); + the_acctMgr = new KMAcctMgr(); the_filterMgr = new KMFilterMgr; the_filterActionDict = new KMFilterActionDict; the_addrBook = new KMAddrBook;