~referencer-devs/referencer/amrlima_gio_port

« back to all changes in this revision

Viewing changes to src/Utility.C

  • Committer: António Lima
  • Date: 2011-08-26 23:32:17 UTC
  • Revision ID: amrlima@gmail.com-20110826233217-llnsoni4uhfolh91
Fixed crash when starting referencer from outside the root directoty of the brach. Thanks to Dominik Kriegner

Show diffs side-by-side

added added

removed removed

Lines of Context:
213
213
                localfile = filename;
214
214
        } else {
215
215
                localfile = Glib::build_filename (
216
 
                        Glib::get_current_dir (), "data");
217
 
                localfile = Glib::build_filename (
218
 
                        localfile, filename);
 
216
                        Glib::get_current_dir (), "data", filename);
219
217
        }
220
218
 
 
219
        
221
220
        Glib::RefPtr<Gio::File> uri =
222
 
    Gio::File::create_for_path (localfile);
 
221
                Gio::File::create_for_path (localfile);
 
222
        
223
223
 
224
224
        if (uri->query_exists ()) {
225
225
                return localfile;
226
226
        } else {
227
227
                Glib::ustring const installedfile =
228
228
                        Glib::build_filename (DATADIR, filename);
229
 
                uri->create_file (Gio::FILE_CREATE_PRIVATE);
 
229
                uri = Gio::File::create_for_path (installedfile);
230
230
                if (uri->query_exists ()) {
231
231
                        return installedfile;
232
232
                }