From 6eb4056d7b90fe3a69cee1e332e2a2957b76c9c5 Mon Sep 17 00:00:00 2001 From: Jiri Moskovcak Date: Fri, 4 Dec 2009 16:30:49 +0100 Subject: GUI: gui fixes from rrakus@redhat.com --- src/Gui/CCMainWindow.py | 42 +-- src/Gui/CCReporterDialog.py | 21 +- src/Gui/PluginsSettingsDialog.py | 1 + src/Gui/SettingsDialog.py | 2 + src/Gui/ccgui.glade | 130 +++----- src/Gui/dialogs.glade | 9 +- src/Gui/report.glade | 262 ++++++++++------- src/Gui/settings.glade | 618 +++++++++++++++++++++------------------ src/Gui/settings_wizard.glade | 34 ++- 9 files changed, 594 insertions(+), 525 deletions(-) (limited to 'src') diff --git a/src/Gui/CCMainWindow.py b/src/Gui/CCMainWindow.py index 8e480509..7de389bd 100644 --- a/src/Gui/CCMainWindow.py +++ b/src/Gui/CCMainWindow.py @@ -60,18 +60,11 @@ class MainWindow(): self.pBarWindow.set_transient_for(self.window) self.pBar = self.wTree.get_widget("pBar") - # set colours for description heading - self.wTree.get_widget("evDescription").modify_bg(gtk.STATE_NORMAL, gtk.gdk.color_parse("black")) - #init the dumps treeview self.dlist = self.wTree.get_widget("tvDumps") #rows of items with: - #icon, package_name, application, date, crash_rate, user (only if root), is_reported, ?object? - if os.getuid() == 0: - # root - self.dumpsListStore = gtk.ListStore(gtk.gdk.Pixbuf, str,str,str,str,str,bool, object) - else: - self.dumpsListStore = gtk.ListStore(gtk.gdk.Pixbuf, str,str,str,str,bool, object) + #icon, package_name, application, date, crash_rate, user, is_reported, ?object? + self.dumpsListStore = gtk.ListStore(gtk.gdk.Pixbuf, str,str,str,str,str,bool, object) # set filter self.modelfilter = self.dumpsListStore.filter_new() self.modelfilter.set_visible_func(self.filter_dumps, None) @@ -82,16 +75,15 @@ class MainWindow(): icon_column.cell.set_property('cell-background', "#C9C9C9") n = self.dlist.append_column(icon_column) icon_column.pack_start(icon_column.cell, False) - icon_column.set_attributes(icon_column.cell, pixbuf=(n-1), cell_background_set=5+(os.getuid() == 0)) + icon_column.set_attributes(icon_column.cell, pixbuf=(n-1), cell_background_set=6) # =============================================== columns = [None]*4 columns[0] = gtk.TreeViewColumn(_("Package")) columns[1] = gtk.TreeViewColumn(_("Application")) columns[2] = gtk.TreeViewColumn(_("Date")) columns[3] = gtk.TreeViewColumn(_("Crash count")) - if os.getuid() == 0: - column = gtk.TreeViewColumn(_("User")) - columns.append(column) + column = gtk.TreeViewColumn(_("User")) + columns.append(column) # create list for column in columns: n = self.dlist.append_column(column) @@ -100,7 +92,7 @@ class MainWindow(): #column.set_attributes(column.cell, ) # FIXME: use some relative indexing column.cell.set_property('cell-background', "#C9C9C9") - column.set_attributes(column.cell, text=(n-1), cell_background_set=5+(os.getuid() == 0)) + column.set_attributes(column.cell, text=(n-1), cell_background_set=6) column.set_resizable(True) #connect signals self.dlist.connect("cursor-changed", self.on_tvDumps_cursor_changed) @@ -204,18 +196,14 @@ class MainWindow(): icon = get_icon_for_package(self.theme, entry.getPackageName()) except: icon = None - if os.getuid() == 0: - user = "N/A" - if entry.getUID() != "-1": - try: - user = pwd.getpwuid(int(entry.getUID()))[0] - except Exception, e: - user = "UID: %s" % entry.getUID() - n = self.dumpsListStore.append([icon, entry.getPackage(), entry.getExecutable(), - entry.getTime("%c"), entry.getCount(), user, entry.isReported(), entry]) - else: - n = self.dumpsListStore.append([icon, entry.getPackage(), entry.getExecutable(), - entry.getTime("%c"), entry.getCount(), entry.isReported(), entry]) + user = "N/A" + if entry.getUID() != "-1": + try: + user = pwd.getpwuid(int(entry.getUID()))[0] + except Exception, e: + user = "UID: %s" % entry.getUID() + n = self.dumpsListStore.append([icon, entry.getPackage(), entry.getExecutable(), + entry.getTime("%c"), entry.getCount(), user, entry.isReported(), entry]) # activate the first row if any.. if n: # we can use (0,) as path for the first row, but what if API changes? @@ -230,7 +218,6 @@ class MainWindow(): if not path: self.wTree.get_widget("bDelete").set_sensitive(False) self.wTree.get_widget("bReport").set_sensitive(False) - self.wTree.get_widget("lDescription").set_label("") return self.wTree.get_widget("bDelete").set_sensitive(True) self.wTree.get_widget("bReport").set_sensitive(True) @@ -248,7 +235,6 @@ class MainWindow(): else: self.wTree.get_widget("lReported").set_markup(_("Not reported!")) lPackage = self.wTree.get_widget("lPackage") - self.wTree.get_widget("lDescription").set_label(dump.getDescription()) def on_bDelete_clicked(self, button, treeview): dumpsListStore, path = self.dlist.get_selection().get_selected_rows() diff --git a/src/Gui/CCReporterDialog.py b/src/Gui/CCReporterDialog.py index 7cdf3cf3..d943c0df 100644 --- a/src/Gui/CCReporterDialog.py +++ b/src/Gui/CCReporterDialog.py @@ -130,7 +130,7 @@ class ReporterDialog(): im = gtk.Image() im.set_from_stock(gtk.STOCK_APPLY, gtk.ICON_SIZE_MENU) box.remove(image) - box.pack_start(im) + box.pack_start(im, expand = False, fill = False) im.show() image.destroy() button.set_sensitive(False) @@ -155,12 +155,13 @@ class ReporterDialog(): vbWrongSettings = builder.get_object("vbWrongSettings") for plugin in wrong_conf_plugs: hbox = gtk.HBox() + hbox.set_spacing(6) image = gtk.Image() image.set_from_stock(gtk.STOCK_CANCEL, gtk.ICON_SIZE_MENU) button = gtk.Button(plugin.getName()) button.connect("clicked", self.on_config_plugin_clicked, plugin, image) hbox.pack_start(button) - hbox.pack_start(image) + hbox.pack_start(image, expand = False, fill = False) vbWrongSettings.pack_start(hbox) vbWrongSettings.show_all() dialog.set_transient_for(self.window) @@ -216,26 +217,32 @@ class ReporterDialog(): except: package = None ebErrors = self.wTree.get_widget("ebErrors") + fReproducer = self.wTree.get_widget("fReproducer") + fComments = self.wTree.get_widget("fComments") lErrors = self.wTree.get_widget("lErrors") bSend = self.wTree.get_widget("bSend") # not usable report if int(self.report[item][CD_CONTENT]) < 3: ebErrors.show() - ebErrors.modify_bg(gtk.STATE_NORMAL, gtk.gdk.color_parse("red")) + fReproducer.hide() + fComments.hide() if package: lErrors.set_markup( - "%s" % _("Reporting disabled because the backtrace is unusable.\nPlease try to install debuginfo manually using command: debuginfo-install %s \nthen use Refresh button to regenerate the backtrace." % package[0:package.rfind('-',0,package.rfind('-'))])) + _("Reporting disabled because the backtrace is unusable.\nPlease try to install debuginfo manually using command: debuginfo-install %s \nthen use Refresh button to regenerate the backtrace." % package[0:package.rfind('-',0,package.rfind('-'))])) else: - lErrors.set_markup("%s" % _("The backtrace is unusable, you can't report this!")) + lErrors.set_markup(_("The backtrace is unusable, you can't report this!")) bSend.set_sensitive(False) # probably usable 3 elif int(self.report[item][CD_CONTENT]) < 4: ebErrors.show() - ebErrors.modify_bg(gtk.STATE_NORMAL, gtk.gdk.color_parse("yellow")) - lErrors.set_markup("%s" % _("The backtrace is incomplete, please make sure you provide good steps to reproduce.")) + fReproducer.hide() + fComments.hide() + lErrors.set_markup(_("The backtrace is incomplete, please make sure you provide good steps to reproduce.")) bSend.set_sensitive(True) else: ebErrors.hide() + fReproducer.show() + fComments.show() bSend.set_sensitive(True) if self.report[item][CD_TYPE] != CD_SYS: diff --git a/src/Gui/PluginsSettingsDialog.py b/src/Gui/PluginsSettingsDialog.py index 39fc7a6f..8453385d 100644 --- a/src/Gui/PluginsSettingsDialog.py +++ b/src/Gui/PluginsSettingsDialog.py @@ -104,6 +104,7 @@ class PluginsSettingsDialog: n = self.pluginsListStore.append(plugin_rows[entry.getType()],["%s\n%s" % (entry.getName(), entry.Description), entry.Enabled == "yes", 1, 0, "white", entry]) self.pluginlist.expand_all() + def dehydrate(self): # we have nothing to save, plugin's does the work pass diff --git a/src/Gui/SettingsDialog.py b/src/Gui/SettingsDialog.py index cf423938..c2b292f7 100644 --- a/src/Gui/SettingsDialog.py +++ b/src/Gui/SettingsDialog.py @@ -157,6 +157,7 @@ class SettingsDialog: def add_CronJob(self, job=None): hbox = gtk.HBox() + hbox.set_spacing(6) time = gtk.Entry() remove_image = gtk.Image() remove_image.set_from_stock("gtk-remove",gtk.ICON_SIZE_MENU) @@ -193,6 +194,7 @@ class SettingsDialog: def add_AnalyzerAction(self, action=None): #print "add_AnalyzerAction" hbox = gtk.HBox() + hbox.set_spacing(6) action_list = gtk.Entry() edit_actions = gtk.Button() edit_actions.set_tooltip_text("Edit actions") diff --git a/src/Gui/ccgui.glade b/src/Gui/ccgui.glade index e9fd96f0..04bc26b5 100644 --- a/src/Gui/ccgui.glade +++ b/src/Gui/ccgui.glade @@ -3,17 +3,22 @@ + 270 + 12 Please wait.. + False True center-on-parent 270 + main_window3 True + 12 - + True - Working... + 0 False @@ -23,43 +28,13 @@ True + 0 False 1 - - - True - - - True - - - False - False - 0 - - - - - True - 0 - - 8 - - - 1 - - - - - False - False - 2 - - @@ -127,6 +102,7 @@ Zdenek Prikryl <zprikryl@redhat.com> True True True + True @@ -153,6 +129,7 @@ Zdenek Prikryl <zprikryl@redhat.com> True True True + True @@ -173,6 +150,7 @@ Zdenek Prikryl <zprikryl@redhat.com> True True True + True @@ -188,6 +166,7 @@ Zdenek Prikryl <zprikryl@redhat.com> True + both True @@ -207,7 +186,7 @@ Zdenek Prikryl <zprikryl@redhat.com> False Report Report - gtk-save + gtk-go-up False @@ -230,58 +209,48 @@ Zdenek Prikryl <zprikryl@redhat.com> - + True True - automatic - automatic + 12 + vertical - + True True + automatic + automatic + in + + + True + True + + + + False + False + - - - 2 - - - - - True - - - True - 0.05000000074505806 - <span color="white">Description</span> - True - - - - - False - 3 - - - - - True - vertical - + True True automatic automatic + in - + True queue + none - + True - 0.10000000149011612 - 0.20000000298023224 + 0 + 0 + Not Reported True @@ -289,33 +258,22 @@ Zdenek Prikryl <zprikryl@redhat.com> - 0 - - - - - True - <b>Not reported!</b> - True - fill - - - 1 + False + True - 4 + 2 True - 2 False - 5 + 3 @@ -329,6 +287,7 @@ Zdenek Prikryl <zprikryl@redhat.com> True True True + True @@ -336,10 +295,11 @@ Zdenek Prikryl <zprikryl@redhat.com> Report True False + True True - gtk-save + gtk-go-up 1 diff --git a/src/Gui/dialogs.glade b/src/Gui/dialogs.glade index 9d24864f..b5e5273a 100644 --- a/src/Gui/dialogs.glade +++ b/src/Gui/dialogs.glade @@ -3,8 +3,9 @@ - 5 + 6 Report done + False True center-on-parent True @@ -14,13 +15,17 @@ True vertical - 2 + 12 True + 6 + 12 True + 0 + 0 gtk-dialog-info 6 diff --git a/src/Gui/report.glade b/src/Gui/report.glade index 29c5c288..08777fb1 100644 --- a/src/Gui/report.glade +++ b/src/Gui/report.glade @@ -3,161 +3,209 @@ - 5 + 6 Report + True center-on-parent 400 400 - dialog + normal False True vertical - 2 + 12 - + True vertical + 12 - - True - Report - - - False - 0 - - - - + True - True - automatic - automatic + vertical + 12 - + True - True + 0 + none + + + True + 12 + + + True + True + automatic + automatic + in + + + True + True + + + + + + + + + True + <b>Following items will be send</b> + True + + + label_item + + + + 0 + - - - 1 - - - - - True - + True - - True + 0 + none + + + True + 12 + + + True + True + automatic + automatic + + + True + queue + + + True + True + word-char + + + + + + + + + + + True + <b>How to reproduce (in a few simple steps)</b> + True + + + label_item + + + + False + False + 1 + - - - False - False - 2 - - - - - 0 - - - - - True - vertical - - - True - + True - 0 - 2 - How to reproduce (in a few simple steps) + 0 + none + + + True + 12 + + + True + True + automatic + automatic + + + True + queue + + + True + True + word-char + + + + + + + + + + + True + <b>Comment</b> + True + + + label_item + + + + False + False + 2 + - False 0 - - True - True - automatic - automatic - - - True - True - word-char - - - - - False - 1 - - - - - False - 2 - - - - - True - vertical - - + True + 12 - + True - 0 - 2 - Comment + gtk-dialog-warning + 6 + + False + False + 0 + - - - False - 0 - - - - - True - True - automatic - automatic - + True - True - word-char + + True + + 1 + False + False 1 - False - 3 + 0 @@ -212,7 +260,7 @@ False end - 0 + 1 diff --git a/src/Gui/settings.glade b/src/Gui/settings.glade index 094286b0..655c15b2 100644 --- a/src/Gui/settings.glade +++ b/src/Gui/settings.glade @@ -5,175 +5,216 @@ Settings True + center-on-parent 450 400 - + True + 12 vertical + 12 - - - - + True - True - never - automatic + vertical + 6 - + True True - - - - - 1 - - - - - True - True - - - True - vertical + immediate + never + automatic + in - + True - 0.05000000074505806 - Nothing selected - - - 0 - - - - - True - Nothing selected + True - - 1 - + + + 0 + + + + + True + True - + True - 3 - 3 - True - - - True - 2.2351741291171123e-10 - 5 - Web Site: - - - 2 - 3 - - + 12 - + True - 2.2351741291171123e-10 - 5 - Author: - - - 1 - 2 - GTK_FILL - - - - - True - 0 - 5 - Version: - - - GTK_FILL - - - - - True - 2.2351741291171123e-10 - Nothing selected - - - 1 - 3 - GTK_FILL - - - - - - True - 2.2351741291171123e-10 - Nothing selected - - - 1 - 3 - 1 - 2 - - - - - True - 0 - Nothing selected + + + True + 5 + 2 + 12 + 6 + + + True + 0 + Web Site: + + + 4 + 5 + GTK_FILL + + + + + True + 2.2351741291171123e-10 + Author: + + + 2 + 3 + GTK_FILL + + + + + True + 0 + Version: + + + 3 + 4 + GTK_FILL + + + + + True + 2.2351741291171123e-10 + True + + + 1 + 2 + 3 + 4 + GTK_FILL + + + + + True + 2.2351741291171123e-10 + True + + + 1 + 2 + 2 + 3 + GTK_FILL + + + + + True + 0 + True + + + 1 + 2 + 4 + 5 + GTK_FILL + + + + + True + 0 + Description: + + + 1 + 2 + GTK_FILL + + + + + True + 0 + Name: + + + + + True + 0 + True + + + 1 + 2 + 1 + 2 + + + + + True + 0 + True + + + 1 + 2 + + + + + False + False + 0 + + + + + - - 1 - 3 - 2 - 3 - - - 2 - + + + + True + <b>Plugin details</b> + True + - - - - True - Plugin Details - + + False + False + 1 + - False - False - 2 + 0 - + True - 11 - - - True - - - - - - 0 - - + 12 + end C_onfigure plugin @@ -183,7 +224,9 @@ True - 1 + False + False + 0 @@ -195,23 +238,16 @@ True - 2 + False + False + 1 False - 3 - - - - - True - 2 - - - False - 4 + False + 1 @@ -220,21 +256,28 @@ Global Settings True + center-on-parent 450 400 True + 12 vertical + 6 True True + False True + 6 5 2 + 12 + 6 Check package GPG signature @@ -258,6 +301,7 @@ 1 2 + GTK_FILL GTK_FILL @@ -283,6 +327,7 @@ 2 3 + GTK_FILL GTK_FILL @@ -296,6 +341,7 @@ 3 4 + GTK_FILL GTK_FILL @@ -309,6 +355,7 @@ 4 5 + GTK_FILL GTK_FILL @@ -331,6 +378,7 @@ True + 6 True @@ -346,7 +394,6 @@ True True True - Edit blacklisted packages imEdit @@ -367,6 +414,7 @@ True + 6 True @@ -414,7 +462,9 @@ True + 6 vertical + 6 True @@ -425,6 +475,7 @@ True queue + none True @@ -480,31 +531,10 @@ - + True - True - - - True - - - - - - 0 - - - - - True - - - - - - 1 - - + 12 + end gtk-add @@ -514,12 +544,15 @@ True - 2 + False + False + 0 False + False 1 @@ -541,84 +574,90 @@ True + 6 vertical + 6 - + True + True + automatic + automatic - - True - <b>Analyzer plugin</b> - True - - - 0 - - - - - True - <b>Associated action</b> - True - - - 1 - - - - + True + queue + none - + + True + vertical + + + True + + + True + <b>Analyzer plugin</b> + True + + + 0 + + + + + True + <b>Associated action</b> + True + + + 1 + + + + + True + + + + + + 2 + + + + + False + 0 + + + + + True + vertical + + + + + + 1 + + + - - 2 - - False 0 - + True - vertical - - - - - - 1 - - - - - True - - - True - - - - - - 0 - - - - - True - - - - - - 1 - - + 12 + end gtk-add @@ -628,13 +667,16 @@ True - 2 + False + False + 0 False - 2 + False + 1 @@ -658,55 +700,36 @@ - + True - True + 12 + end - + + gtk-cancel True - - - + True + True + True + False + False 0 - + + gtk-ok True - 14 - True - - - gtk-cancel - True - True - True - True - - - False - 0 - - - - - gtk-ok - True - False - True - True - This function is not implemented yet! - True - - - False - 1 - - + False + True + True + True + False + False 1 @@ -724,21 +747,13 @@ 1000000 1 - - True - gtk-edit - 1 - - - True - gtk-edit - 1 - GPG Keys True + center-on-parent 400 400 + wGlobalSettings True @@ -753,9 +768,11 @@ - + True - True + 12 + 12 + end gtk-add @@ -765,6 +782,8 @@ True + False + False 0 @@ -777,6 +796,8 @@ True + False + False 1 @@ -789,6 +810,8 @@ True + False + False 2 @@ -801,16 +824,29 @@ True + False + False 3 False + False 1 + + True + gtk-edit + 1 + + + True + gtk-edit + 1 + diff --git a/src/Gui/settings_wizard.glade b/src/Gui/settings_wizard.glade index feab4351..e0d54a1e 100644 --- a/src/Gui/settings_wizard.glade +++ b/src/Gui/settings_wizard.glade @@ -5,24 +5,47 @@ 5 Wrong Settings Detected + False + center-on-parent normal False True vertical - 2 + 6 True vertical + 6 - + True - <b>WARNING:</b> Wrong settings detected for some of the enabled reporter plugins, please use the buttons below to open respective configuration and fix it before you proceed, otherwise the reporting process can fail. + 12 + + + True + gtk-dialog-warning + 6 + + + 0 + + + + + True + Wrong settings detected for some of the enabled reporter plugins, please use the buttons below to open respective configuration and fix it before you proceed, otherwise the reporting process can fail. - True - True + True + fill + True + + + 1 + + 0 @@ -32,6 +55,7 @@ True vertical + 6 -- cgit From 230f151aa7e357c37040ed51bcbdbc1a766af82a Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Fri, 4 Dec 2009 16:32:57 +0100 Subject: simplify code which deletes corrupted debug dumps; kill unused EXCEP_FATAL Signed-off-by: Denys Vlasenko --- src/Daemon/CommLayerServerSocket.h | 2 +- src/Daemon/CrashWatcher.cpp | 56 ++++++++++++++------------------------ src/Daemon/CrashWatcher.h | 4 +-- src/Daemon/Daemon.cpp | 16 +---------- src/Daemon/MiddleWare.cpp | 24 ---------------- src/Daemon/MiddleWare.h | 11 -------- 6 files changed, 24 insertions(+), 89 deletions(-) (limited to 'src') diff --git a/src/Daemon/CommLayerServerSocket.h b/src/Daemon/CommLayerServerSocket.h index baca195d..d1f464cc 100644 --- a/src/Daemon/CommLayerServerSocket.h +++ b/src/Daemon/CommLayerServerSocket.h @@ -28,7 +28,7 @@ class CCommLayerServerSocket : public CCommLayerServer virtual vector_crash_infos_t GetCrashInfos(const std::string& pSender); virtual report_status_t Report(const map_crash_report_t& pReport, const std::string& pSender); - virtual bool DeleteDebugDump(const std::string& pUUID, const std::string& pSender); + virtual void DeleteDebugDump(const std::string& pUUID, const std::string& pSender); virtual void Crash(const std::string& arg1); }; diff --git a/src/Daemon/CrashWatcher.cpp b/src/Daemon/CrashWatcher.cpp index 7f19ea32..1606f86d 100644 --- a/src/Daemon/CrashWatcher.cpp +++ b/src/Daemon/CrashWatcher.cpp @@ -69,27 +69,15 @@ vector_crash_infos_t GetCrashInfos(const char *pUID) retval.push_back(info); break; case MW_ERROR: - error_msg("Can't find dump directory for UUID %s, deleting from database", uuid); - DeleteCrashInfoInDB(uuid, uid); - break; - case MW_FILE_ERROR: - error_msg("Can't open file in dump directory for UUID %s, deleting", uuid); - { - std::string debugDumpDir = DeleteCrashInfoInDB(uuid, uid); - delete_debug_dump_dir(debugDumpDir.c_str()); - } - break; - default: + error_msg("Dump directory for UUID %s doesn't exist or misses crucial files, deleting", uuid); + /* Deletes both DB record and dump dir */ + DeleteDebugDump(uuid, uid); break; } } } catch (CABRTException& e) { - if (e.type() == EXCEP_FATAL) - { - throw e; - } error_msg("%s", e.what()); } @@ -126,12 +114,9 @@ map_crash_report_t CreateReport(const char* pUUID, const char* pUID, int force) case MW_PLUGIN_ERROR: error_msg("Particular analyzer plugin isn't loaded or there is an error within plugin(s)"); break; - case MW_CORRUPTED: - case MW_FILE_ERROR: default: error_msg("Corrupted crash with UUID %s, deleting", pUUID); - std::string debugDumpDir = DeleteCrashInfoInDB(pUUID, pUID); - delete_debug_dump_dir(debugDumpDir.c_str()); + DeleteDebugDump(pUUID, pUID); break; } return crashReport; @@ -204,40 +189,39 @@ int CreateReportThread(const char* pUUID, const char* pUID, int force, const cha return r; } -bool DeleteDebugDump(const char *pUUID, const char *pUID) + +/* Remove dump dir and its DB record */ +void DeleteDebugDump(const char *pUUID, const char *pUID) { try { - std::string debugDumpDir = DeleteCrashInfoInDB(pUUID, pUID); - delete_debug_dump_dir(debugDumpDir.c_str()); + CDatabase* database = g_pPluginManager->GetDatabase(g_settings_sDatabase.c_str()); + database->Connect(); + database_row_t row = database->GetRow(pUUID, pUID); + database->DeleteRow(pUUID, pUID); + database->DisConnect(); + + delete_debug_dump_dir(row.m_sDebugDumpDir.c_str()); } catch (CABRTException& e) { - if (e.type() == EXCEP_FATAL) - { - throw e; - } error_msg("%s", e.what()); - return false; } - return true; } -bool DeleteDebugDump_by_dir(const char *dump_dir) +void DeleteDebugDump_by_dir(const char *dump_dir) { try { - DeleteCrashInfosInDB_by_dir(dump_dir); + CDatabase* database = g_pPluginManager->GetDatabase(g_settings_sDatabase.c_str()); + database->Connect(); + database->DeleteRows_by_dir(dump_dir); + database->DisConnect(); + delete_debug_dump_dir(dump_dir); } catch (CABRTException& e) { - if (e.type() == EXCEP_FATAL) - { - throw e; - } error_msg("%s", e.what()); - return false; } - return true; } diff --git a/src/Daemon/CrashWatcher.h b/src/Daemon/CrashWatcher.h index 3f543e18..a8064367 100644 --- a/src/Daemon/CrashWatcher.h +++ b/src/Daemon/CrashWatcher.h @@ -51,7 +51,7 @@ class CCrashWatcher vector_crash_infos_t GetCrashInfos(const char *pUID); int CreateReportThread(const char* pUUID, const char* pUID, int force, const char* pSender); map_crash_report_t CreateReport(const char* pUUID, const char* pUID, int force); -bool DeleteDebugDump(const char *pUUID, const char *pUID); -bool DeleteDebugDump_by_dir(const char *dump_dir); +void DeleteDebugDump(const char *pUUID, const char *pUID); +void DeleteDebugDump_by_dir(const char *dump_dir); #endif diff --git a/src/Daemon/Daemon.cpp b/src/Daemon/Daemon.cpp index 6f901f39..f9910dce 100644 --- a/src/Daemon/Daemon.cpp +++ b/src/Daemon/Daemon.cpp @@ -343,11 +343,6 @@ static void FindNewDumps(const char* pPath) VERB1 log("Already saved crash %s, deleting", itt->c_str()); delete_debug_dump_dir(itt->c_str()); break; - case MW_BLACKLISTED: - case MW_CORRUPTED: - case MW_PACKAGE_ERROR: - case MW_GPG_ERROR: - case MW_FILE_ERROR: default: log("Corrupted or bad crash %s (res:%d), deleting", itt->c_str(), (int)res); delete_debug_dump_dir(itt->c_str()); @@ -356,10 +351,6 @@ static void FindNewDumps(const char* pPath) } catch (CABRTException& e) { - if (e.type() == EXCEP_FATAL) - { - throw e; - } error_msg("%s", e.what()); } } @@ -545,12 +536,7 @@ static gboolean handle_inotify_cb(GIOChannel *gio, GIOCondition condition, gpoin } catch (CABRTException& e) { - error_msg(e.what()); - if (e.type() == EXCEP_FATAL) - { - free(buf); - return -1; - } + error_msg("%s", e.what()); } catch (...) { diff --git a/src/Daemon/MiddleWare.cpp b/src/Daemon/MiddleWare.cpp index 676f168a..8528f644 100644 --- a/src/Daemon/MiddleWare.cpp +++ b/src/Daemon/MiddleWare.cpp @@ -520,26 +520,6 @@ report_status_t Report(const map_crash_report_t& pCrashReport, return ret; } -std::string DeleteCrashInfoInDB(const char *pUUID, - const char *pUID) -{ - CDatabase* database = g_pPluginManager->GetDatabase(g_settings_sDatabase.c_str()); - database->Connect(); - database_row_t row = database->GetRow(pUUID, pUID); - database->DeleteRow(pUUID, pUID); - database->DisConnect(); - - return row.m_sDebugDumpDir; -} - -void DeleteCrashInfosInDB_by_dir(const char *dump_dir) -{ - CDatabase* database = g_pPluginManager->GetDatabase(g_settings_sDatabase.c_str()); - database->Connect(); - database->DeleteRows_by_dir(dump_dir); - database->DisConnect(); -} - /** * Check whether particular debugdump directory is saved * in database. This check is done together with an UID of an user. @@ -861,10 +841,6 @@ mw_result_t FillCrashInfo(const char *pUUID, catch (CABRTException& e) { error_msg("%s", e.what()); - if (e.type() == EXCEP_DD_LOAD) - { - return MW_FILE_ERROR; - } return MW_ERROR; } diff --git a/src/Daemon/MiddleWare.h b/src/Daemon/MiddleWare.h index 44fa3b6b..b2b58dcd 100644 --- a/src/Daemon/MiddleWare.h +++ b/src/Daemon/MiddleWare.h @@ -104,17 +104,6 @@ report_status_t Report(const map_crash_report_t& pCrashReport, */ std::string getDebugDumpDir( const char *pUUID, const char *pUID); -/** - * Deletes a row from database. If a deleting is - * successfull, it returns a debugdump directort, which is not - * deleted. Otherwise, it returns empty string. - * @param pUUID A local UUID of a crash. - * @param pUID An UID of an user. - * @return A debugdump directory. - */ -std::string DeleteCrashInfoInDB(const char *pUUID, - const char *pUID); -void DeleteCrashInfosInDB_by_dir(const char *dump_dir); /** * Saves debugdump into database. If saving is successful, * it fills crash info. -- cgit