Dor dicke Gind
2 years ago
2 changed files with 32 additions and 1 deletions
@ -0,0 +1,29 @@ |
|||||||
|
diff --git a/src/gldit/cairo-dock-utils.c b/src/gldit/cairo-dock-utils.c
|
||||||
|
index 76b6d6c6..3b05d22a 100644
|
||||||
|
--- a/src/gldit/cairo-dock-utils.c
|
||||||
|
+++ b/src/gldit/cairo-dock-utils.c
|
||||||
|
@@ -35,14 +35,20 @@ gchar *cairo_dock_generate_unique_filename (const gchar *cBaseName, const gchar
|
||||||
|
do
|
||||||
|
{
|
||||||
|
iPrefixNumber ++;
|
||||||
|
- g_string_printf (sFileName, "%s/%02d%s", cCairoDockDataDir, iPrefixNumber, cBaseName);
|
||||||
|
- } while (iPrefixNumber < 99 && g_file_test (sFileName->str, G_FILE_TEST_EXISTS));
|
||||||
|
+ if (iPrefixNumber < 100)
|
||||||
|
+ g_string_printf (sFileName, "%s/%02d%s", cCairoDockDataDir, iPrefixNumber, cBaseName);
|
||||||
|
+ else
|
||||||
|
+ g_string_printf (sFileName, "%s/%03d%s", cCairoDockDataDir, iPrefixNumber, cBaseName);
|
||||||
|
+
|
||||||
|
+ } while (iPrefixNumber < 1000 && g_file_test (sFileName->str, G_FILE_TEST_EXISTS));
|
||||||
|
|
||||||
|
g_string_free (sFileName, TRUE);
|
||||||
|
- if (iPrefixNumber == 99)
|
||||||
|
+ if (iPrefixNumber < 100)
|
||||||
|
+ return g_strdup_printf ("%02d%s", iPrefixNumber, cBaseName);
|
||||||
|
+ if (iPrefixNumber == 1000)
|
||||||
|
return NULL;
|
||||||
|
else
|
||||||
|
- return g_strdup_printf ("%02d%s", iPrefixNumber, cBaseName);
|
||||||
|
+ return g_strdup_printf ("%03d%s", iPrefixNumber, cBaseName);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in new issue