summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKarel Klic <kklic@redhat.com>2010-02-03 21:43:52 +0100
committerKarel Klic <kklic@redhat.com>2010-02-03 21:43:52 +0100
commitf7c4cfae10637533bacb21503d7cc41a7575ec0a (patch)
tree9ee7f4e53d900f6c9492d803d4ac90977632dff0 /src
parent432df42f6036da0e2425a1369ad19e5527e7d5b5 (diff)
parent84234fa714e176255bb5fc89f5a7baa54ae0fdbe (diff)
downloadabrt-f7c4cfae10637533bacb21503d7cc41a7575ec0a.tar.gz
abrt-f7c4cfae10637533bacb21503d7cc41a7575ec0a.tar.xz
abrt-f7c4cfae10637533bacb21503d7cc41a7575ec0a.zip
Merge branch 'master' of git://git.fedorahosted.org/git/abrt
Diffstat (limited to 'src')
-rw-r--r--src/CLI/report.cpp16
-rw-r--r--src/Gui/PluginsSettingsDialog.py16
2 files changed, 23 insertions, 9 deletions
diff --git a/src/CLI/report.cpp b/src/CLI/report.cpp
index 76cd3d5..2bcd52a 100644
--- a/src/CLI/report.cpp
+++ b/src/CLI/report.cpp
@@ -38,26 +38,25 @@
* Trims whitespace characters both from left and right side of a string.
* Modifies the string in-place. Returns the trimmed string.
*/
-char *trim(char *str)
+static char *trim(char *str)
{
if (!str)
return NULL;
// Remove leading spaces.
char *ibuf;
- for (ibuf = str; *ibuf && isspace(*ibuf); ++ibuf)
- continue;
+ ibuf = skip_whitespace(str);
+ int i = strlen(ibuf);
if (str != ibuf)
- memmove(str, ibuf, ibuf - str);
+ memmove(str, ibuf, i + 1);
// Remove trailing spaces.
- int i = strlen(str);
while (--i >= 0)
{
if (!isspace(str[i]))
break;
}
- str[++i] = NULL;
+ str[++i] = '\0';
return str;
}
@@ -198,6 +197,8 @@ static void write_crash_report(const map_crash_data_t &report, FILE *fp)
_("# How to reproduce the crash?"));
write_crash_report_field(fp, report, FILENAME_BACKTRACE,
_("# Stack trace: a list of active stack frames at the time the crash occurred\n# Check that it does not contain any sensitive data such as passwords."));
+ write_crash_report_field(fp, report, FILENAME_KERNELOOPS,
+ _("# Kernel oops: kernel log snippet\n# Check that it does not contain any sensitive data such as passwords."));
write_crash_report_field(fp, report, CD_DUPHASH, "# DUPHASH");
write_crash_report_field(fp, report, FILENAME_ARCHITECTURE, _("# Architecture"));
write_crash_report_field(fp, report, FILENAME_CMDLINE, _("# Command line"));
@@ -221,7 +222,7 @@ static void write_crash_report(const map_crash_data_t &report, FILE *fp)
static int read_crash_report_field(const char *text, map_crash_data_t &report,
const char *field)
{
- char separator[strlen("\n" FIELD_SEP) + strlen(field) + 2]; // 2 = '\n\0'
+ char separator[sizeof("\n" FIELD_SEP)-1 + strlen(field) + 2]; // 2 = '\n\0'
sprintf(separator, "\n%s%s\n", FIELD_SEP, field);
const char *textfield = strstr(text, separator);
if (!textfield)
@@ -285,6 +286,7 @@ static int read_crash_report(map_crash_data_t &report, const char *text)
result |= read_crash_report_field(text, report, FILENAME_COMMENT);
result |= read_crash_report_field(text, report, FILENAME_REPRODUCE);
result |= read_crash_report_field(text, report, FILENAME_BACKTRACE);
+ result |= read_crash_report_field(text, report, FILENAME_KERNELOOPS);
result |= read_crash_report_field(text, report, CD_DUPHASH);
result |= read_crash_report_field(text, report, FILENAME_ARCHITECTURE);
result |= read_crash_report_field(text, report, FILENAME_CMDLINE);
diff --git a/src/Gui/PluginsSettingsDialog.py b/src/Gui/PluginsSettingsDialog.py
index 611a8c5..0ba390d 100644
--- a/src/Gui/PluginsSettingsDialog.py
+++ b/src/Gui/PluginsSettingsDialog.py
@@ -97,22 +97,34 @@ class PluginsSettingsDialog:
# don't force refresh as it will overwrite settings if g-k is not available
pluginlist = getPluginInfoList(self.ccdaemon)
except Exception, e:
- print e
+ log("Error while loading plugins info: %s", e)
#gui_error_message("Error while loading plugins info, please check if abrt daemon is running\n %s" % e)
return
plugin_rows = {}
+ group_empty = {}
for plugin_type in PluginInfo.types.keys():
it = self.pluginsListStore.append(None,
+ # cell_text, toggle_active, toggle_visible, group_name_visible, color, plugin
["<b>%s</b>" % PluginInfo.types[plugin_type], 0, 0, 1, "gray", None])
plugin_rows[plugin_type] = it
+ group_empty[plugin_type] = 1
for entry in pluginlist:
if entry.Description:
text = "<b>%s</b>\n%s" % (entry.getName(), entry.Description)
else:
# non-loaded plugins have empty description
text = "<b>%s</b>" % entry.getName()
- self.pluginsListStore.append(plugin_rows[entry.getType()],
+ plugin_type = entry.getType()
+ self.pluginsListStore.append(plugin_rows[plugin_type],
+ # cell_text, toggle_active, toggle_visible, group_name_visible, color, plugin
[text, entry.Enabled == "yes", 1, 0, "white", entry])
+ group_empty[plugin_type] = 0
+ # rhbz#560971 "Don't show empty 'Not loaded plugins' section"
+ for plugin_type in group_empty.keys():
+ if group_empty[plugin_type]:
+ self.pluginsListStore.append(plugin_rows[plugin_type],
+ # cell_text, toggle_active, toggle_visible, group_name_visible, color, plugin
+ ["(none)", 0, 1, 0, "white", None])
self.pluginlist.expand_all()
def dehydrate(self):