From e9ae80694875f869892f13f4fcaf1170a00dea41 Mon Sep 17 00:00:00 2001 From: toma Date: Wed, 25 Nov 2009 17:56:58 +0000 Subject: Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features. BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdewebdev@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kfilereplace/kfilereplacelib.h | 65 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 kfilereplace/kfilereplacelib.h (limited to 'kfilereplace/kfilereplacelib.h') diff --git a/kfilereplace/kfilereplacelib.h b/kfilereplace/kfilereplacelib.h new file mode 100644 index 00000000..e5c14c72 --- /dev/null +++ b/kfilereplace/kfilereplacelib.h @@ -0,0 +1,65 @@ +/*************************************************************************** + kfilereplacelib.h - File library, derived from filelib.h + ------------------- + begin : lun mai 3 20:19:52 CEST 1999 + + copyright : (C) 1999 by François Dupoux + (C) 2003 Andras Mantia + (C) 2004 Emiliano Gulmini + email : dupoux@dupoux.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef KFILEREPLACELIB_H +#define KFILEREPLACELIB_H + +// KDE +#include +class KlistView; + +// local +#include "configurationclasses.h" + +class KFileReplaceLib +{ + public: + + /** + Format a path, from a path and a filename, or another sub-path (avoid double '/' risks) + Parameters::.....* basePath: fist path (can be "/" if root, or "/usr/bin/" or "/usr/bin" for example) + .................* filename: second path (can be "/doc/html/", or "doc/html/" or "doc/html/index.html" for example) + Return values:...* Full valid path (without double "/") + */ + static QString formatFullPath(const QString& basePath, const QString& fileName); + + /** + Add an extension to a filename, or a filepath + Parameters::.....* filename: filename or filepath (it can have already the extension) + .................* extension: extension to add without "." (ex: "html", "kfr") + Return values:...* Filename / Filepath with the extension + */ + static QString addExtension(const QString& fileName, const QString& extension); + + static QString formatFileSize(double size); + + /** + converts the old kfr format file in the new xml-based format. + */ + static void convertOldToNewKFRFormat(const QString& fileName, KListView* stringView); + /** + Verifies that files, which we are scanning, respect some + conditions + */ + static bool isAnAccessibleFile(const QString& filePath, const QString& fileName, RCOptions* info); + + static void setIconForFileEntry(QListViewItem* item, QString path); +}; +#endif // KFILEREPLACEFILELIB_H -- cgit v1.2.1