Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit b3299530 authored by Michael Pyne's avatar Michael Pyne

Port away from KSaveFile.

parent f8ee589b
......@@ -19,7 +19,6 @@
#include "juk-exception.h"
#include <kstandarddirs.h>
#include <ksavefile.h>
#include <kmessagebox.h>
#include <kconfig.h>
#include <klocale.h>
......@@ -29,6 +28,7 @@
#include <QDir>
#include <QBuffer>
#include <QtGlobal>
#include <QSaveFile>
#include "tag.h"
#include "searchplaylist.h"
......@@ -185,7 +185,7 @@ void Cache::savePlaylists(const PlaylistList &playlists)
}
QString playlistsFile = dirName + "/playlists";
KSaveFile f(playlistsFile);
QSaveFile f(playlistsFile);
if(!f.open(QIODevice::WriteOnly)) {
qCCritical(JUK_LOG) << "Error saving collection:" << f.errorString();
......@@ -231,9 +231,8 @@ void Cache::savePlaylists(const PlaylistList &playlists)
fs << qChecksum(data.data(), data.size());
fs << data;
f.close();
if(!f.finalize())
if(!f.commit())
qCCritical(JUK_LOG) << "Error saving collection:" << f.errorString();
}
......
......@@ -23,7 +23,6 @@
#include <kconfiggroup.h>
#include <kglobal.h>
#include <kactioncollection.h>
#include <ksavefile.h>
#include <kstandarddirs.h>
#include <ktoolbarpopupaction.h>
#include <kdirwatch.h>
......@@ -37,6 +36,7 @@
#include <QClipboard>
#include <QFileInfo>
#include <QHeaderView>
#include <QSaveFile>
#include "playlistcollection.h"
#include "splashscreen.h"
......@@ -242,7 +242,7 @@ void CollectionList::saveItemsToCache() const
QString cacheFileName =
KGlobal::dirs()->saveLocation("appdata") + QLatin1String("cache");
KSaveFile f(cacheFileName);
QSaveFile f(cacheFileName);
if(!f.open(QIODevice::WriteOnly)) {
qCCritical(JUK_LOG) << "Error saving cache:" << f.errorString();
......@@ -267,9 +267,7 @@ void CollectionList::saveItemsToCache() const
<< checksum
<< data;
f.close();
if(!f.finalize())
if(!f.commit())
qCCritical(JUK_LOG) << "Error saving cache:" << f.errorString();
}
......
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