--- a/filemanager/src/inc/fmutils_win.cpp Fri Jun 11 13:29:48 2010 +0300
+++ b/filemanager/src/inc/fmutils_win.cpp Wed Jun 23 18:03:11 2010 +0300
@@ -195,8 +195,12 @@
bool FmUtils::isDriveC( const QString &driverName )
{
- Q_UNUSED( driverName );
- return false;
+ if( driverName.contains("C",Qt::CaseInsensitive) ){
+ return true;
+ }
+ else{
+ return false;
+ }
}
bool FmUtils::isDrive( const QString &path )
@@ -216,14 +220,23 @@
QString FmUtils::fillPathWithSplash( const QString &filePath )
{
- QString newFilePath( filePath );
+ QString newFilePath;
if( filePath.isEmpty() ) {
return newFilePath;
}
- if( filePath.at( filePath.length()-1 ) != QChar( '/' ) ){
- newFilePath.append( QChar( '/' ) );
+ foreach( QChar ch, filePath ) {
+ if( ch == QChar('\\') || ch == QChar('/') ) {
+ newFilePath.append( QDir::separator() );
+ } else {
+ newFilePath.append( ch );
+ }
}
+
+ if( newFilePath.right( 1 )!= QDir::separator() ){
+ newFilePath.append( QDir::separator() );
+ }
+
return newFilePath;
}
@@ -418,8 +431,19 @@
QString FmUtils::formatPath( const QString &path )
{
- Q_UNUSED( path );
- return false;
+ QString formatPath;
+ foreach( QChar ch, path ) {
+ if( ch == QChar('\\') || ch == QChar('/') ) {
+ formatPath.append( QDir::separator() );
+ } else {
+ formatPath.append( ch );
+ }
+ }
+
+ if( formatPath.right( 1 ) != QDir::separator() ){
+ formatPath.append( QDir::separator() );
+ }
+ return formatPath;
}
int FmUtils::getMaxFileNameLength()