summaryrefslogtreecommitdiff
path: root/shell/main.c
diff options
context:
space:
mode:
authorPablo Barciela <[email protected]>2020-04-15 05:33:24 +0200
committerRobert Antoni Buj Gelonch <[email protected]>2020-04-15 17:25:45 +0200
commit1f3566651994ead4813dc3253f65ec8a523ecf35 (patch)
tree2e406970577bef1e621d027718424149929a79ed /shell/main.c
parent8170ddddafadbd2268de83872536eb8c385cfa6a (diff)
downloadatril-1f3566651994ead4813dc3253f65ec8a523ecf35.tar.bz2
atril-1f3566651994ead4813dc3253f65ec8a523ecf35.tar.xz
Fix cppcheck [knownConditionTrueFalse] warnings
Fixes the warnings: backend/comics/comics-document.c:767:21: style: Condition 'bytes<=0' is always true [knownConditionTrueFalse] backend/epub/minizip/unzip.c:603:25: style: Condition 'unz_copyright[0]!=' '' is always false [knownConditionTrueFalse] properties/ev-properties-view.c:197:33: style: Condition 'text' is always true [knownConditionTrueFalse] shell/ev-sidebar-thumbnails.c:598:7: style: Condition '!loading_icon' is always true [knownConditionTrueFalse] shell/main.c:115:6: style: Condition '!error' is always true [knownConditionTrueFalse]
Diffstat (limited to 'shell/main.c')
-rw-r--r--shell/main.c21
1 files changed, 9 insertions, 12 deletions
diff --git a/shell/main.c b/shell/main.c
index 582ffe2f..d85876be 100644
--- a/shell/main.c
+++ b/shell/main.c
@@ -80,10 +80,11 @@ static const GOptionEntry goption_options[] =
static gboolean
launch_previewer (void)
{
- GString *cmd_str;
- gchar *cmd;
- gboolean retval = FALSE;
- GError *error = NULL;
+ GString *cmd_str;
+ gchar *cmd;
+ GAppInfo *app;
+ gboolean retval = FALSE;
+ GError *error = NULL;
/* Rebuild the command line, ignoring options
* not supported by the previewer and taking only
@@ -112,15 +113,11 @@ launch_previewer (void)
cmd = g_string_free (cmd_str, FALSE);
- if (!error) {
- GAppInfo *app;
+ app = g_app_info_create_from_commandline (cmd, NULL, 0, &error);
- app = g_app_info_create_from_commandline (cmd, NULL, 0, &error);
-
- if (app != NULL) {
- retval = g_app_info_launch (app, NULL, NULL, &error);
- g_object_unref (app);
- }
+ if (app != NULL) {
+ retval = g_app_info_launch (app, NULL, NULL, &error);
+ g_object_unref (app);
}
if (error) {