Add a utility function fsCasePreserving.

Returns true if the underlying file system is case preserving instead
of case sensitive. That is true for Mac and Windows currently. Only
Linux has a case sensitive file system usually.
This commit is contained in:
Klaas Freitag 2014-05-23 15:59:29 +02:00
parent 18677dbc3f
commit ef0a3c212e
2 changed files with 15 additions and 0 deletions

View file

@ -348,6 +348,15 @@ static bool checkDolphinCanSelect()
return p.readAll().contains("--select");
}
bool Utility::fsCasePreserving()
{
bool re = false;
if( isWindows() || isMac() ) {
re = true;
}
return re;
}
// inspired by Qt Creator's showInGraphicalShell();
void Utility::showInFileManager(const QString &localPath)
{

View file

@ -69,6 +69,12 @@ namespace Utility
OWNCLOUDSYNC_EXPORT bool isUnix();
OWNCLOUDSYNC_EXPORT bool isLinux(); // use with care
// Case preserving file system underneath?
// if this function returns true, the file system is case preserving,
// that means "test" means the same as "TEST" for filenames.
// if false, the two cases are two different files.
OWNCLOUDSYNC_EXPORT bool fsCasePreserving();
class StopWatch {
private:
QHash<QString, quint64> _lapTimes;