Commit d0ba2cca authored by Paulo Lieuthier's avatar Paulo Lieuthier Committed by Pali Rohár

Re-enable XML-based history plugin, fix history file saving

The history plugin port was not completed, so it is disabled.
This patch re-enables it, fixes it's building failures and fixes
not saving the history file when the directory doesn't exist.

Tested last messages appearance on reopening a chat window,
using Jabber and Test Protocol.

REVIEW: 130154
parent f97d0fd6
......@@ -21,7 +21,7 @@
#include <QWidget>
#include "../kopetemessage.h"
#include "../libkopete_export.h"
#include "libkopete_export.h"
namespace Kopete {
class ViewPlugin;
......
option(WITH_latex "Enable Kopete latex plugin" OFF) # to be fixed or rewritten
option(WITH_autoreplace "Enable Kopete autoreplace plugin" ON)
option(WITH_history "Enable Kopete history plugin" OFF) # To be re-written
option(WITH_history "Enable Kopete history plugin" ON) # To be re-written
option(WITH_history2 "Enable Kopete history2 plugin" OFF) # To be re-written
option(WITH_contactnotes "Enable Kopete contactnotes plugin" ON)
option(WITH_translator "Enable Kopete translator plugin" OFF)
......
include_directories(
${KOPETE_INCLUDES}
include_directories(
${KOPETE_INCLUDES}
${KOPETE_BINARY_DIR}
)
......@@ -16,6 +17,8 @@ set(kopete_history_PART_SRCS
kconfig_add_kcfg_files(kopete_history_PART_SRCS historyconfig.kcfgc )
ki18n_wrap_ui(kopete_history_PART_SRCS historyviewer.ui)
add_library(kopete_history MODULE ${kopete_history_PART_SRCS})
set_target_properties(kopete_history PROPERTIES AUTOMOC TRUE)
......@@ -30,6 +33,7 @@ set(kcm_kopete_history_PART_SRCS historypreferences.cpp )
kconfig_add_kcfg_files(kcm_kopete_history_PART_SRCS historyconfig.kcfgc )
ki18n_wrap_ui(kcm_kopete_history_PART_SRCS historyprefsui.ui)
add_library(kcm_kopete_history MODULE ${kcm_kopete_history_PART_SRCS})
set_target_properties(kcm_kopete_history PROPERTIES AUTOMOC TRUE)
......@@ -46,7 +50,3 @@ install( FILES historyconfig.kcfg DESTINATION ${KDE_INSTALL_KCFGDIR})
install( FILES kopete_history.desktop DESTINATION ${KDE_INSTALL_KSERVICES5DIR})
install( FILES historyui.rc historychatui.rc DESTINATION ${KDE_INSTALL_DATADIR}/kopete_history)
install( FILES kopete_history_config.desktop DESTINATION ${KDE_INSTALL_KSERVICES5DIR}/kconfiguredialog)
......@@ -27,6 +27,7 @@
#include <kpluginfactory.h>
#include <QIcon>
#include <kactioncollection.h>
#include <kdebug.h>
#include "kopetechatsession.h"
#include "kopetechatsessionmanager.h"
......
......@@ -346,6 +346,9 @@ void HistoryLogger::saveToDisk()
QTime t;
t.start(); //mesure the time needed to save.
// create directory if it does not exist
QDir().mkpath(QFileInfo(m_toSaveFileName).absolutePath());
QSaveFile file(m_toSaveFileName);
if (file.open(QIODevice::WriteOnly)) {
QString buf;
......
......@@ -28,6 +28,8 @@
#include <kdeversion.h>
#include <QIcon>
#include <kactioncollection.h>
#include <klocalizedstring.h>
#include <kdebug.h>
#include "kopetechatsessionmanager.h"
#include "kopetemetacontact.h"
......
......@@ -24,6 +24,7 @@
#include <kcolorbutton.h>
#include <knuminput.h>
#include <kpluginfactory.h>
#include <kdebug.h>
#include "historyconfig.h"
#include "ui_historyprefsui.h"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment