summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 65c7c18)
raw | patch | inline | side by side (parent: 65c7c18)
author | johanengelen <johanengelen@users.sourceforge.net> | |
Sun, 1 Mar 2009 22:09:49 +0000 (22:09 +0000) | ||
committer | johanengelen <johanengelen@users.sourceforge.net> | |
Sun, 1 Mar 2009 22:09:49 +0000 (22:09 +0000) |
src/file.cpp | patch | blob | history |
diff --git a/src/file.cpp b/src/file.cpp
index 2467b8914771199ac535e63daa7c742c4ccb2dba..f2a4884d41325644c96c33ece9a38a54b135870d 100644 (file)
--- a/src/file.cpp
+++ b/src/file.cpp
#ifdef NEW_EXPORT_DIALOG
-static Inkscape::UI::Dialog::FileExportDialog *exportDialogInstance = NULL;
-
/**
* Display an Export dialog, export as the selected type if OK pressed
*/
export_path = export_path_local;
//# Show the SaveAs dialog
- if (!exportDialogInstance)
- exportDialogInstance =
- Inkscape::UI::Dialog::FileExportDialog::create(
- export_path,
- Inkscape::UI::Dialog::EXPORT_TYPES,
- (char const *) _("Select file to export to"),
- default_extension
- );
+ Inkscape::UI::Dialog::FileExportDialog *exportDialogInstance =
+ Inkscape::UI::Dialog::FileExportDialog::create(
+ export_path,
+ Inkscape::UI::Dialog::EXPORT_TYPES,
+ (char const *) _("Select file to export to"),
+ default_extension
+ );
bool success = exportDialogInstance->show();
- if (!success)
+ if (!success) {
+ delete exportDialogInstance;
return success;
+ }
Glib::ustring fileName = exportDialogInstance->getFilename();
Inkscape::Extension::Extension *selectionType =
exportDialogInstance->getSelectionType();
+ delete exportDialogInstance;
+ exportDialogInstance = NULL;
if (fileName.size() > 0) {
Glib::ustring newFileName = Glib::filename_to_utf8(fileName);
bool success = false;
- static Inkscape::UI::Dialog::FileExportToOCALDialog *exportDialogInstance = NULL;
- static Inkscape::UI::Dialog::FileExportToOCALPasswordDialog *exportPasswordDialogInstance = NULL;
static bool gotSuccess = false;
Inkscape::XML::Node *repr = sp_document_repr_root(doc);
export_path = export_path_local;
// Show the Export To OCAL dialog
- if (!exportDialogInstance)
- exportDialogInstance = new Inkscape::UI::Dialog::FileExportToOCALDialog(
+ Inkscape::UI::Dialog::FileExportToOCALDialog *exportDialogInstance =
+ new Inkscape::UI::Dialog::FileExportToOCALDialog(
parentWindow,
Inkscape::UI::Dialog::EXPORT_TYPES,
(char const *) _("Select file to export to")
);
success = exportDialogInstance->show();
- if (!success)
+ if (!success) {
+ delete exportDialogInstance;
return success;
+ }
fileName = exportDialogInstance->getFilename();
+ delete exportDialogInstance;
+ exportDialogInstance = NULL;;
+
fileName.append(filename_extension.c_str());
if (fileName.size() > 0) {
Glib::ustring newFileName = Glib::filename_to_utf8(fileName);
Glib::ustring password = prefs->getString("/options/ocalpassword/str");
if (username.empty() || password.empty())
{
+ Inkscape::UI::Dialog::FileExportToOCALPasswordDialog *exportPasswordDialogInstance = NULL;
if(!gotSuccess)
{
- if (!exportPasswordDialogInstance)
- exportPasswordDialogInstance = new Inkscape::UI::Dialog::FileExportToOCALPasswordDialog(
+ exportPasswordDialogInstance = new Inkscape::UI::Dialog::FileExportToOCALPasswordDialog(
parentWindow,
(char const *) _("Open Clip Art Login"));
success = exportPasswordDialogInstance->show();
- if (!success)
+ if (!success) {
+ delete exportPasswordDialogInstance;
return success;
+ }
}
username = exportPasswordDialogInstance->getUsername();
password = exportPasswordDialogInstance->getPassword();
+
+ delete exportPasswordDialogInstance;
+ exportPasswordDialogInstance = NULL;
}
uri.append(username);
uri.append(":");
if (!doc)
return;
- static Inkscape::UI::Dialog::FileImportFromOCALDialog *importDialogInstance = NULL;
+ Inkscape::UI::Dialog::FileImportFromOCALDialog *importDialogInstance = NULL;
if (!importDialogInstance) {
importDialogInstance = new
}
bool success = importDialogInstance->show();
- if (!success)
+ if (!success) {
+ delete importDialogInstance;
return;
+ }
// Get file name and extension type
Glib::ustring fileName = importDialogInstance->getFilename();
- Inkscape::Extension::Extension *selection =
- importDialogInstance->getSelectionType();
+ Inkscape::Extension::Extension *selection = importDialogInstance->getSelectionType();
+
+ delete importDialogInstance;
+ importDialogInstance = NULL;
if (fileName.size() > 0) {