[gnome-commander/gcmd-1-10: 1/2] Don't show error if startup directory is missing



commit 255b66e5368ac8398fbe07cdca5211c667ba060c
Author: Uwe Scholz <u scholz83 gmx de>
Date:   Fri Jun 26 21:58:48 2020 +0200

    Don't show error if startup directory is missing

 src/gnome-cmd-dir.cc      | 7 +++++--
 src/gnome-cmd-dir.h       | 2 +-
 src/gnome-cmd-main-win.cc | 2 +-
 3 files changed, 7 insertions(+), 4 deletions(-)
---
diff --git a/src/gnome-cmd-dir.cc b/src/gnome-cmd-dir.cc
index c207db18..4ac15ca3 100644
--- a/src/gnome-cmd-dir.cc
+++ b/src/gnome-cmd-dir.cc
@@ -296,7 +296,7 @@ GnomeCmdDir *gnome_cmd_dir_new_with_con (GnomeCmdCon *con)
 }
 
 
-GnomeCmdDir *gnome_cmd_dir_new (GnomeCmdCon *con, GnomeCmdPath *path)
+GnomeCmdDir *gnome_cmd_dir_new (GnomeCmdCon *con, GnomeCmdPath *path, gboolean isStartup)
 {
     g_return_val_if_fail (GNOME_CMD_IS_CON (con), nullptr);
     g_return_val_if_fail (path!=nullptr, nullptr);
@@ -332,7 +332,10 @@ GnomeCmdDir *gnome_cmd_dir_new (GnomeCmdCon *con, GnomeCmdPath *path)
     }
     else
     {
-        gnome_cmd_show_message (*main_win, path->get_display_path(), gnome_vfs_result_to_string (res));
+        if (!isStartup)
+        {
+            gnome_cmd_show_message (*main_win, path->get_display_path(), gnome_vfs_result_to_string (res));
+        }
         gnome_vfs_file_info_unref (info);
     }
 
diff --git a/src/gnome-cmd-dir.h b/src/gnome-cmd-dir.h
index 8544c76f..4b552211 100644
--- a/src/gnome-cmd-dir.h
+++ b/src/gnome-cmd-dir.h
@@ -87,7 +87,7 @@ struct GnomeCmdCon;
 
 GnomeCmdDir *gnome_cmd_dir_new_from_info (GnomeVFSFileInfo *info, GnomeCmdDir *parent);
 GnomeCmdDir *gnome_cmd_dir_new_with_con (GnomeCmdCon *con);
-GnomeCmdDir *gnome_cmd_dir_new (GnomeCmdCon *con, GnomeCmdPath *path);
+GnomeCmdDir *gnome_cmd_dir_new (GnomeCmdCon *con, GnomeCmdPath *path, gboolean isStartup = false);
 GnomeCmdDir *gnome_cmd_dir_get_parent (GnomeCmdDir *dir);
 GnomeCmdDir *gnome_cmd_dir_get_child (GnomeCmdDir *dir, const gchar *child);
 GnomeCmdCon *gnome_cmd_dir_get_connection (GnomeCmdDir *dir);
diff --git a/src/gnome-cmd-main-win.cc b/src/gnome-cmd-main-win.cc
index 60beb01c..a2dcce37 100644
--- a/src/gnome-cmd-main-win.cc
+++ b/src/gnome-cmd-main-win.cc
@@ -1216,7 +1216,7 @@ void GnomeCmdMainWin::open_tabs(FileSelectorID id)
 
     for (vector<GnomeCmdData::Tab>::const_iterator i=gnome_cmd_data.tabs[id].begin(); i!=last_tab; ++i)
     {
-        GnomeCmdDir *dir = gnome_cmd_dir_new (home, gnome_cmd_con_create_path (home, i->first.c_str()));
+        GnomeCmdDir *dir = gnome_cmd_dir_new (home, gnome_cmd_con_create_path (home, i->first.c_str()), 
true);
         fs(id)->new_tab(dir, i->second.first, i->second.second, i->second.third, TRUE);
     }
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]