[gnote] Fix sharp::directory_get_files_with_ext



commit 8c347b9ee76a8516bb9885c1d6e831e8aa3d14d7
Author: Aurimas Ä?ernius <aurisc4 gmail com>
Date:   Sun Mar 27 15:29:15 2011 +0300

    Fix sharp::directory_get_files_with_ext
    
    Operate on and return files with paths.

 src/sharp/directory.cpp |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/src/sharp/directory.cpp b/src/sharp/directory.cpp
index d9ee931..a01a0d2 100644
--- a/src/sharp/directory.cpp
+++ b/src/sharp/directory.cpp
@@ -1,6 +1,7 @@
 /*
  * gnote
  *
+ * Copyright (C) 2011 Aurimas Cernius
  * Copyright (C) 2011 Debarshi Ray
  * Copyright (C) 2009 Hubert Figuiere
  * 
@@ -50,12 +51,13 @@ namespace sharp {
     Glib::Dir d(dir);
 
     for (Glib::Dir::iterator itr = d.begin(); itr != d.end(); ++itr) {
-      const sharp::FileInfo file_info(*itr);
+      const std::string file(dir + "/" + *itr);
+      const sharp::FileInfo file_info(file);
       const std::string & extension = file_info.get_extension();
 
-      if (Glib::file_test(*itr, Glib::FILE_TEST_IS_REGULAR)
+      if (Glib::file_test(file, Glib::FILE_TEST_IS_REGULAR)
           && (ext.empty() || (sharp::string_to_lower(extension) == ext))) {
-        list.push_back(*itr);
+        list.push_back(file);
       }
     }
   }



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