b62ee0089f
* src/addr_compl.c * src/addrindex.c * src/addritem.c * src/codeconv.c * src/compose.c * src/filtering.c * src/folder.c * src/folder_item_prefs.c * src/folderview.c * src/localfolder.c * src/matcher.c * src/mimeview.c * src/prefs_msg_colors.c * src/prefs_spelling.c * src/prefs_themes.c * src/procmime.c * src/procmsg.c * src/stock_pixmap.c * src/summaryview.c * src/textview.c * src/toolbar.c * src/common/mgutils.c * src/common/prefs.c * src/common/ssl_certificate.c * src/gtk/colorlabel.c * src/gtk/quicksearch.c * src/plugins/pgpmime/pgpmime.c * src/plugins/spamassassin/spamassassin.c Removed redundant NULL checks for g_free() calls. Patch by Pawel Pekala.
69 lines
1.9 KiB
C
69 lines
1.9 KiB
C
/*
|
|
* Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
|
|
* Copyright (C) 2002 by the Sylpheed Claws Team and Hiroyuki Yamamoto
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License as published by
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
* (at your option) any later version.
|
|
*
|
|
* This program is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License
|
|
* along with this program; if not, write to the Free Software
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
*/
|
|
|
|
#include <glib.h>
|
|
|
|
#include "folder.h"
|
|
#include "localfolder.h"
|
|
#include "xml.h"
|
|
|
|
void folder_local_folder_init(Folder *folder, const gchar *name,
|
|
const gchar *path)
|
|
{
|
|
folder_init(folder, name);
|
|
LOCAL_FOLDER(folder)->rootpath = g_strdup(path);
|
|
}
|
|
|
|
void folder_local_folder_destroy(LocalFolder *lfolder)
|
|
{
|
|
g_return_if_fail(lfolder != NULL);
|
|
|
|
g_free(lfolder->rootpath);
|
|
}
|
|
|
|
void folder_local_set_xml(Folder *_folder, XMLTag *tag)
|
|
{
|
|
LocalFolder *folder = LOCAL_FOLDER(_folder);
|
|
GList *cur;
|
|
|
|
folder_set_xml(_folder, tag);
|
|
|
|
for (cur = tag->attr; cur != NULL; cur = g_list_next(cur)) {
|
|
XMLAttr *attr = (XMLAttr *) cur->data;
|
|
|
|
if (!attr || !attr->name || !attr->value) continue;
|
|
if (!strcmp(attr->name, "path")) {
|
|
g_free(folder->rootpath);
|
|
folder->rootpath = g_strdup(attr->value);
|
|
}
|
|
}
|
|
}
|
|
|
|
XMLTag *folder_local_get_xml(Folder *_folder)
|
|
{
|
|
LocalFolder *folder = LOCAL_FOLDER(_folder);
|
|
XMLTag *tag;
|
|
|
|
tag = folder_get_xml(_folder);
|
|
|
|
xml_tag_add_attr(tag, xml_attr_new("path", folder->rootpath));
|
|
|
|
return tag;
|
|
}
|