Author: kitone
Date: Sun Apr 12 12:51:59 2015
New Revision: 903
URL: http://svn.gna.org/viewcvs/subtitleeditor?rev=903&view=rev
Log:
Fix bug #23148 : Create new untilted name with extension.
Modified:
trunk/ChangeLog
trunk/plugins/actions/documentmanagement/documentmanagement.cc
trunk/src/documentsystem.cc
trunk/src/documentsystem.h
Modified: trunk/ChangeLog
URL:
http://svn.gna.org/viewcvs/subtitleeditor/trunk/ChangeLog?rev=903&r1=902&r2=903&view=diff
==============================================================================
--- trunk/ChangeLog (original)
+++ trunk/ChangeLog Sun Apr 12 12:51:59 2015
@@ -1,3 +1,10 @@
+2015-04-12 kitone <[email protected]>
+
+ * plugins/actions/documentmanagement/documentmanagement.cc:
+ * src/documentsystem.cc:
+ * src/documentsystem.h:
+ Fix bug #23148 : Create new untilted name with extension.
+
2015-04-12 kitone <[email protected]>
* plugins/actions/documentmanagement/documentmanagement.cc:
Modified: trunk/plugins/actions/documentmanagement/documentmanagement.cc
URL:
http://svn.gna.org/viewcvs/subtitleeditor/trunk/plugins/actions/documentmanagement/documentmanagement.cc?rev=903&r1=902&r2=903&view=diff
==============================================================================
--- trunk/plugins/actions/documentmanagement/documentmanagement.cc
(original)
+++ trunk/plugins/actions/documentmanagement/documentmanagement.cc Sun Apr
12 12:51:59 2015
@@ -246,7 +246,8 @@
g_return_if_fail(doc);
-
doc->setFilename(DocumentSystem::getInstance().create_untitled_name());
+ Glib::ustring ext =
SubtitleFormatSystem::instance().get_extension_of_format(doc->getFormat());
+
doc->setFilename(DocumentSystem::getInstance().create_untitled_name(ext));
DocumentSystem::getInstance().append(doc);
}
Modified: trunk/src/documentsystem.cc
URL:
http://svn.gna.org/viewcvs/subtitleeditor/trunk/src/documentsystem.cc?rev=903&r1=902&r2=903&view=diff
==============================================================================
--- trunk/src/documentsystem.cc (original)
+++ trunk/src/documentsystem.cc Sun Apr 12 12:51:59 2015
@@ -190,19 +190,21 @@
/*
* find a unique name (like "Untitled-5") for a new document
*/
-Glib::ustring DocumentSystem::create_untitled_name()
+Glib::ustring DocumentSystem::create_untitled_name(const Glib::ustring
&extension)
{
se_debug(SE_DEBUG_PLUGINS);
+
+ Glib::ustring ext = extension.empty() ? "" : "." + extension;
const gchar *untitled = _("Untitled %d");
unsigned int i=1;
- while(check_if_document_name_exist(build_message(untitled, i)))
+ while(check_if_document_name_exist(build_message(untitled, i) + ext))
{
++i;
}
- return build_message(untitled, i);
+ return build_message(untitled, i) + ext;
}
/*
Modified: trunk/src/documentsystem.h
URL:
http://svn.gna.org/viewcvs/subtitleeditor/trunk/src/documentsystem.h?rev=903&r1=902&r2=903&view=diff
==============================================================================
--- trunk/src/documentsystem.h (original)
+++ trunk/src/documentsystem.h Sun Apr 12 12:51:59 2015
@@ -87,7 +87,7 @@
/*
* Find a unique name (like "Untitled-5") for a new document
*/
- Glib::ustring create_untitled_name();
+ Glib::ustring create_untitled_name(const Glib::ustring &extension = "");
/*
* Check with other document if this name exist
_______________________________________________
Subtitleeditor-commits mailing list
[email protected]
https://mail.gna.org/listinfo/subtitleeditor-commits