Solving bug reported in issue 1341: "PP3 file cleanup" ...application's crash if the default raw or image profile didn't exist

This commit is contained in:
natureh
2012-05-25 10:42:56 +02:00
parent e5d42eb5eb
commit 6ae731e84a
17 changed files with 386 additions and 61 deletions

View File

@@ -126,11 +126,9 @@ void ProfilePanel::save_clicked (GdkEventButton* event) {
Gtk::FileChooserDialog dialog(M("PROFILEPANEL_SAVEDLGLABEL"), Gtk::FILE_CHOOSER_ACTION_SAVE);
if (options.loadSaveProfilePath.length())
dialog.set_current_folder (options.loadSaveProfilePath);
else if (options.multiUser)
dialog.set_current_folder (Options::rtdir + "/" + options.profilePath);
dialog.set_current_folder (options.loadSaveProfilePath);
else
dialog.set_current_folder (argv0 + "/" + options.profilePath);
dialog.set_current_folder (options.getPreferredProfilePath());
//Add response buttons the the dialog:
dialog.add_button(Gtk::StockID("gtk-cancel"), Gtk::RESPONSE_CANCEL);
@@ -269,10 +267,8 @@ void ProfilePanel::load_clicked (GdkEventButton* event) {
Gtk::FileChooserDialog dialog(M("PROFILEPANEL_LOADDLGLABEL"), Gtk::FILE_CHOOSER_ACTION_OPEN);
if (options.loadSaveProfilePath.length())
dialog.set_current_folder (options.loadSaveProfilePath);
else if (options.multiUser)
dialog.set_current_folder (Options::rtdir + "/" + options.profilePath);
else
dialog.set_current_folder (argv0 + "/" + options.profilePath);
dialog.set_current_folder (options.getPreferredProfilePath());
//Add response buttons the the dialog:
dialog.add_button(Gtk::StockID("gtk-cancel"), Gtk::RESPONSE_CANCEL);
@@ -489,13 +485,19 @@ void ProfilePanel::initProfile (const Glib::ustring& profname, ProcParams* lastS
profiles->set_active (0);
PartialProfile* s = profileStore.getProfile (profiles->get_active_text());
if (!s) {
changeconn.block (false);
s = new PartialProfile (true);
s->set(true);
dels = true; // we've created a temporary PartialProfile, so we set a flag to destroy it
if (tpc)
tpc->profileChange (s, EvPhotoLoaded, DEFPROFILE_INTERNAL);
}
else {
Glib::ustring cProfile = profiles->get_active_text();
changeconn.block (false);
if (tpc)
tpc->profileChange (s, EvPhotoLoaded, cProfile);
}
changeconn.block (false);
if (tpc)
tpc->profileChange (s, EvPhotoLoaded, profiles->get_active_text());
if (dels) {
s->deleteInstance();