~midori/midori/trunk

« back to all changes in this revision

Viewing changes to midori/midori-download.vala

  • Committer: tuxator at o2
  • Date: 2016-01-15 19:18:17 UTC
  • mto: This revision was merged to the branch mainline in revision 7089.
  • Revision ID: tuxator@o2.pl-20160115191817-swae4ef7xai0bni4
Use g_file_test check instead as it works for both platforms

Show diffs side-by-side

added added

removed removed

Lines of Context:
341
341
        }
342
342
 
343
343
        public string get_unique_filename (string filename) {
344
 
            if (Midori.Paths.check_file_exists (filename)) {
 
344
            if (GLib.FileUtils.test (filename, GLib.FileTest.EXISTS)) {
345
345
                string basename;
346
346
                string? extension = get_extension_for_uri (filename, out basename);
347
347
                string? new_filename = null;
348
348
                int i = 0;
349
349
                do {
350
350
                    new_filename = "%s-%d%s".printf (basename, i++, extension ?? "");
351
 
                } while (Midori.Paths.check_file_exists (new_filename));
 
351
                } while (GLib.FileUtils.test (new_filename, GLib.FileTest.EXISTS));
352
352
                return new_filename;
353
353
            }
354
354
            return filename;