[gnome-commander] Only use gFileInfo member in get_extension method
- From: Uwe Scholz <uwescholz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-commander] Only use gFileInfo member in get_extension method
- Date: Sat, 15 May 2021 21:00:56 +0000 (UTC)
commit 511587434379465f259ff7ee92ab324f28916fd3
Author: Uwe Scholz <u scholz83 gmx de>
Date: Wed May 12 23:07:15 2021 +0200
Only use gFileInfo member in get_extension method
src/gnome-cmd-file.cc | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
---
diff --git a/src/gnome-cmd-file.cc b/src/gnome-cmd-file.cc
index e5fadcb7..c2127ae8 100644
--- a/src/gnome-cmd-file.cc
+++ b/src/gnome-cmd-file.cc
@@ -717,14 +717,12 @@ gchar *GnomeCmdFile::get_uri_str()
const gchar *GnomeCmdFile::get_extension()
{
- g_return_val_if_fail (info != nullptr, nullptr);
+ g_return_val_if_fail (gFileInfo != nullptr, nullptr);
if (GetGfileAttributeUInt32(G_FILE_ATTRIBUTE_STANDARD_TYPE) == G_FILE_TYPE_DIRECTORY)
return nullptr;
- const char *s = strrchr (g_file_info_get_name(this->gFileInfo), '.'); // does NOT work on UTF-8
strings, should be (MUCH SLOWER):
- // const char *s = g_utf8_strrchr (info->name, -1, '.');
-
+ const char *s = strrchr (g_file_info_get_name(gFileInfo), '.');
return s ? s+1 : nullptr;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]