aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/messaging/IMAPFolder.cpp4
-rw-r--r--src/messaging/POP3Folder.cpp4
-rw-r--r--src/messaging/maildirFolder.cpp5
-rw-r--r--src/utility/path.cpp2
4 files changed, 9 insertions, 6 deletions
diff --git a/src/messaging/IMAPFolder.cpp b/src/messaging/IMAPFolder.cpp
index ce5b5236..f197f360 100644
--- a/src/messaging/IMAPFolder.cpp
+++ b/src/messaging/IMAPFolder.cpp
@@ -40,8 +40,8 @@ namespace messaging {
IMAPFolder::IMAPFolder(const folder::path& path, IMAPStore* store, const int type, const int flags)
: m_store(store), m_connection(m_store->connection()), m_path(path),
- m_name(path.getLastComponent()), m_mode(-1), m_open(false), m_type(type), m_flags(flags),
- m_messageCount(0), m_uidValidity(0)
+ m_name(path.isEmpty() ? folder::path::component("") : path.getLastComponent()), m_mode(-1),
+ m_open(false), m_type(type), m_flags(flags), m_messageCount(0), m_uidValidity(0)
{
m_store->registerFolder(this);
}
diff --git a/src/messaging/POP3Folder.cpp b/src/messaging/POP3Folder.cpp
index 61e3475b..1bccf9ea 100644
--- a/src/messaging/POP3Folder.cpp
+++ b/src/messaging/POP3Folder.cpp
@@ -30,7 +30,9 @@ namespace messaging {
POP3Folder::POP3Folder(const folder::path& path, POP3Store* store)
- : m_store(store), m_path(path), m_name(path.getLastComponent()), m_mode(-1), m_open(false)
+ : m_store(store), m_path(path),
+ m_name(path.isEmpty() ? folder::path::component("") : path.getLastComponent()),
+ m_mode(-1), m_open(false)
{
m_store->registerFolder(this);
}
diff --git a/src/messaging/maildirFolder.cpp b/src/messaging/maildirFolder.cpp
index 19153907..e63f6d61 100644
--- a/src/messaging/maildirFolder.cpp
+++ b/src/messaging/maildirFolder.cpp
@@ -36,8 +36,9 @@ namespace messaging {
maildirFolder::maildirFolder(const folder::path& path, maildirStore* store)
- : m_store(store), m_path(path), m_name(path.getLastComponent()), m_mode(-1), m_open(false),
- m_unreadMessageCount(0), m_messageCount(0)
+ : m_store(store), m_path(path),
+ m_name(path.isEmpty() ? folder::path::component("") : path.getLastComponent()),
+ m_mode(-1), m_open(false), m_unreadMessageCount(0), m_messageCount(0)
{
m_store->registerFolder(this);
}
diff --git a/src/utility/path.cpp b/src/utility/path.cpp
index b7651615..03ce6098 100644
--- a/src/utility/path.cpp
+++ b/src/utility/path.cpp
@@ -150,7 +150,7 @@ const bool path::isEmpty() const
const path::component path::getLastComponent() const
{
- return (isEmpty() ? component("") : m_list[m_list.size() - 1]);
+ return (m_list[m_list.size() - 1]);
}