From 56a51fb8a595ca2260274794cdadd2666daf25a8 Mon Sep 17 00:00:00 2001 From: "Dirk-Jan C. Binnema" Date: Thu, 18 Jan 2007 15:29:49 +0000 Subject: [PATCH] * all: - modest global #defines to modest-defs.h pmo-trunk-r663 --- src/modest-account-keys.h | 65 ------------------------- src/modest-account-mgr.c | 1 - src/modest-conf-keys.h | 102 ---------------------------------------- src/modest-conf.h | 2 +- src/modest-init.c | 1 + src/modest-local-folder-info.c | 6 ++- src/modest-local-folder-info.h | 1 + src/modest-tny-account-store.c | 9 ++-- src/modest-tny-account-store.h | 1 + 9 files changed, 11 insertions(+), 177 deletions(-) delete mode 100644 src/modest-account-keys.h delete mode 100644 src/modest-conf-keys.h diff --git a/src/modest-account-keys.h b/src/modest-account-keys.h deleted file mode 100644 index ed9d301..0000000 --- a/src/modest-account-keys.h +++ /dev/null @@ -1,65 +0,0 @@ -/* Copyright (c) 2006, Nokia Corporation - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the Nokia Corporation nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS - * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A - * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER - * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - - -#ifndef __MODEST_ACCOUNT_KEYS_H__ -#define __MODEST_ACCOUNT_KEYS_H__ - -#include "modest-conf-keys.h" - -#define MODEST_CONF_DEFAULT_ACCOUNT "/default_account" - - -/* configuration key definitions for modest */ -#define MODEST_ACCOUNT_NAMESPACE MODEST_CONF_NAMESPACE "/" "accounts" -#define MODEST_SERVER_ACCOUNT_NAMESPACE MODEST_CONF_NAMESPACE "/" "server_accounts" -#define MODEST_CONF_REPLY_TYPE "reply_type" /* int */ -#define MODEST_CONF_FORWARD_TYPE "forward_type" /* int */ - -/* per-account data */ -#define MODEST_ACCOUNT_DISPLAY_NAME "display_name" /* string */ -#define MODEST_ACCOUNT_STORE_ACCOUNT "store_account" /* string */ -#define MODEST_ACCOUNT_TRANSPORT_ACCOUNT "transport_account" /* string */ -#define MODEST_ACCOUNT_FULLNAME "fullname" -#define MODEST_ACCOUNT_EMAIL "email" - -/* server account keys */ -#define MODEST_ACCOUNT_PASSWORD "password" /* string */ -#define MDOEST_ACCOUNT_REMEMBER_PWD "remember_pwd" /* boolean */ -#define MODEST_ACCOUNT_HOSTNAME "hostname" /* string */ -#define MODEST_ACCOUNT_USERNAME "username" /* string */ -#define MODEST_ACCOUNT_PROTO "proto" /* string */ -#define MODEST_ACCOUNT_ENABLED "enabled" /* boolean */ -#define MODEST_ACCOUNT_TYPE "type" /* string */ - -#define MODEST_ACCOUNT_LEAVE_ON_SERVER "leave_on_server" /* boolean */ -#define MODEST_ACCOUNT_PREFERRED_CNX "preferred_cnx" /* string */ -#define MODEST_ACCOUNT_OPTIONS "options" /* list */ - -#endif /*__MODEST_CONF_KEYS_H__*/ diff --git a/src/modest-account-mgr.c b/src/modest-account-mgr.c index c08dbb6..77deee5 100644 --- a/src/modest-account-mgr.c +++ b/src/modest-account-mgr.c @@ -29,7 +29,6 @@ #include #include "modest-marshal.h" -#include "modest-account-keys.h" #include "modest-account-mgr.h" /* 'private'/'protected' functions */ diff --git a/src/modest-conf-keys.h b/src/modest-conf-keys.h deleted file mode 100644 index 98c90e4..0000000 --- a/src/modest-conf-keys.h +++ /dev/null @@ -1,102 +0,0 @@ -/* Copyright (c) 2006, Nokia Corporation - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the Nokia Corporation nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS - * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A - * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER - * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - - -#ifndef __MODEST_CONF_KEYS_H__ -#define __MODEST_CONF_KEYS_H__ - -/* configuration key definitions for modest */ -#define MODEST_CONF_NAMESPACE "/apps/modest" - -/* place for widget settings */ -#define MODEST_CONF_WIDGET_NAMESPACE MODEST_CONF_NAMESPACE "/widgets" - - - -/* - * the widget settings below are obsolete - */ - - -/* - * the main window - */ -#define MODEST_MAIN_WINDOW_HEIGHT MODEST_CONF_NAMESPACE "/main_window_height" /* int */ -#define MODEST_MAIN_WINDOW_HEIGHT_DEFAULT 480 /* int */ - -#define MODEST_MAIN_WINDOW_WIDTH MODEST_CONF_NAMESPACE "/main_window_width" /* int */ -#define MODEST_MAIN_WINDOW_WIDTH_DEFAULT 800 - - - -/* - * the next 5 parameters determine the window size - */ -#define MODEST_MAIN_PANED_HEIGHT MODEST_CONF_NAMESPACE "/main_paned_height" -#define MODEST_MAIN_PANED_HEIGHT_DEFAULT 600 - -/* the folders / favorites (on the left) */ -#define MODEST_FOLDER_PANED_WIDTH MODEST_CONF_NAMESPACE "/folder_paned_width" -#define MODEST_FOLDER_PANED_WIDTH_DEFAULT 150 -/* percentage the of the height of the favorites folders */ -#define MODEST_FOLDER_PANED_DIVIDER_POS MODEST_CONF_NAMESPACE "/folder_paned_divider_pos" -#define MODEST_FOLDER_PANED_DIVIDER_POS_DEFAULT 100 - -/* the messages / headers (on the right) */ -#define MODEST_MSG_PANED_WIDTH MODEST_CONF_NAMESPACE "/msg_paned_width" -#define MODEST_MSG_PANED_WIDTH_DEFAULT 600 - -/* percentage the of the height of the headers */ -#define MODEST_MSG_PANED_DIVIDER_POS MODEST_CONF_NAMESPACE "/msg_paned_divider_pos" -#define MODEST_MSG_PANED_DIVIDER_POS_DEFAULT 40 - - - - - - -/* - * the account view window - */ -#define MODEST_ACCOUNT_VIEW_WINDOW_HEIGHT_DEFAULT 500 -#define MODEST_ACCOUNT_VIEW_WINDOW_WIDTH_DEFAULT 300 - - -#define MODEST_EDIT_WINDOW_HEIGHT MODEST_CONF_NAMESPACE "/edit_window_height" /* int */ -#define MODEST_EDIT_WINDOW_HEIGHT_DEFAULT 480 /* int */ - -#define MODEST_EDIT_WINDOW_WIDTH MODEST_CONF_NAMESPACE "/edit_window_width" /* int */ -#define MODEST_EDIT_WINDOW_WIDTH_DEFAULT 800 - -#define MODEST_MSG_VIEW_NAMESPACE MODEST_NAMESPACE "/view" - -#define MODEST_MSG_VIEW_SHOW_ATTACHMENTS_INLINE MODEST_MSG_VIEW_NAMESPACE "/show_attachments_inline" /* boolean */ - - -#endif /*__MODEST_CONF_KEYS_H__*/ diff --git a/src/modest-conf.h b/src/modest-conf.h index 33643e2..699a74d 100644 --- a/src/modest-conf.h +++ b/src/modest-conf.h @@ -31,7 +31,7 @@ #define __MODEST_CONF_H__ #include -#include "modest-conf-keys.h" +#include "modest-defs.h" G_BEGIN_DECLS diff --git a/src/modest-init.c b/src/modest-init.c index 908142a..ed8048b 100644 --- a/src/modest-init.c +++ b/src/modest-init.c @@ -28,6 +28,7 @@ */ #include +#include #include #include #include diff --git a/src/modest-local-folder-info.c b/src/modest-local-folder-info.c index 1c89200..2c1ca5e 100644 --- a/src/modest-local-folder-info.c +++ b/src/modest-local-folder-info.c @@ -93,7 +93,9 @@ modest_local_folder_info_get_type_display_name (ModestLocalFolderType type) gchar * modest_local_folder_info_get_maildir_path (void) { - return g_build_filename (g_get_home_dir(), ".modest", - "local_folders", NULL); + return g_build_filename (g_get_home_dir(), + MODEST_DIR, + MODEST_LOCAL_FOLDERS_MAILDIR, + NULL); } diff --git a/src/modest-local-folder-info.h b/src/modest-local-folder-info.h index 8e2937d..42fe037 100644 --- a/src/modest-local-folder-info.h +++ b/src/modest-local-folder-info.h @@ -33,6 +33,7 @@ G_BEGIN_DECLS #include +#include typedef enum { MODEST_LOCAL_FOLDER_TYPE_UNKNOWN, diff --git a/src/modest-tny-account-store.c b/src/modest-tny-account-store.c index 593298a..a3d588f 100644 --- a/src/modest-tny-account-store.c +++ b/src/modest-tny-account-store.c @@ -579,11 +579,6 @@ modest_tny_account_store_get_accounts (TnyAccountStore *iface, TnyList *list, tny_session_camel_set_account_store (priv->tny_session_camel, iface); } - -/* - * the cache dir will be ~/.modest/cache - * might want to change this in a simple #define... - */ static const gchar* modest_tny_account_store_get_cache_dir (TnyAccountStore *self) { @@ -591,7 +586,9 @@ modest_tny_account_store_get_cache_dir (TnyAccountStore *self) priv = MODEST_TNY_ACCOUNT_STORE_GET_PRIVATE(self); if (!priv->cache_dir) - priv->cache_dir = g_build_filename (g_get_home_dir(), ".modest", + priv->cache_dir = g_build_filename (g_get_home_dir(), + MODEST_DIR, + MODEST_CACHE_DIR, "cache", NULL); return priv->cache_dir; } diff --git a/src/modest-tny-account-store.h b/src/modest-tny-account-store.h index 81ffa97..aa29ea8 100644 --- a/src/modest-tny-account-store.h +++ b/src/modest-tny-account-store.h @@ -34,6 +34,7 @@ #define __MODEST_TNY_ACCOUNT_STORE_H__ #include +#include #include #include #include -- 1.7.9.5