gparted r1091 - in trunk: . include src



Author: gedakc
Date: Fri Mar 13 14:17:22 2009
New Revision: 1091
URL: http://svn.gnome.org/viewvc/gparted?rev=1091&view=rev

Log:
Removed file_exists() method.  Glib::file_test() already exists and is available for use.

Modified:
   trunk/ChangeLog
   trunk/include/Utils.h
   trunk/src/Utils.cc

Modified: trunk/include/Utils.h
==============================================================================
--- trunk/include/Utils.h	(original)
+++ trunk/include/Utils.h	Fri Mar 13 14:17:22 2009
@@ -154,8 +154,6 @@
 	static void tokenize( const Glib::ustring& str,
 	                      std::vector<Glib::ustring>& tokens,
 	                      const Glib::ustring& delimiters ) ;
-	static bool file_exists( const char* filename ) ;
-	static bool file_exists( const Glib::ustring& filename ) ;
 };
 
 

Modified: trunk/src/Utils.cc
==============================================================================
--- trunk/src/Utils.cc	(original)
+++ trunk/src/Utils.cc	Fri Mar 13 14:17:22 2009
@@ -21,7 +21,6 @@
 #include <iomanip>
 #include <regex.h>
 #include <locale.h>
-#include <sys/stat.h>	//Used in file_exists() method
 
 
 namespace GParted
@@ -442,34 +441,5 @@
 	}
 }
 
-//The file_exists method copied and adapted from:
-//  http://wiki.forum.nokia.com/index.php/CS001101_-_Checking_if_a_file_exists_in_C_and_C%2B%2B
-bool Utils::file_exists( const char* filename )
-{
-	struct stat info ;
-	int ret = -1 ;
-	
-	//get the file attributes
-	ret = stat(filename, &info) ;
-	if(ret == 0)
-	{
-		//stat() is able to get the file attributes,
-		//so the file obviously exists
-		return true ;
-	}
-	else
-	{
-		//stat() is not able to get the file attributes,
-		//so the file obviously does not exist or
-		//more capabilities is required
-		return false ;
-	}
-}
-
-bool Utils::file_exists( const Glib::ustring& filename )
-{
-	return file_exists( filename .c_str() ) ;
-}
-
 
 } //GParted..



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]