Skip to content

Commit

Permalink
fix #10
Browse files Browse the repository at this point in the history
  • Loading branch information
dpurgin committed Jan 14, 2015
1 parent 732eec8 commit ef23979
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions libcallrecorder/src/eventstablemodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include <QVector>

#include "database.h"
#include "settings.h"
#include "sqlcursor.h"

class EventsTableModel::EventsTableModelPrivate
Expand Down Expand Up @@ -151,9 +152,9 @@ class EventsTableModel::EventsTableModelPrivate

if (db->execute("DELETE FROM Events WHERE ID = :id", params))
{
QString location = QStandardPaths::writableLocation(QStandardPaths::DataLocation) %
QLatin1String("/data/") %
fileName;
Settings settings;

QString location = settings.outputLocation() % QLatin1Char('/') % fileName;

qDebug() << "Removing" << location;

Expand All @@ -171,7 +172,7 @@ class EventsTableModel::EventsTableModelPrivate
{
result = false;

qDebug() << "Error removing databse row: " << db->lastError();
qDebug() << "Error removing database row: " << db->lastError();
}

return result;
Expand Down Expand Up @@ -238,10 +239,7 @@ bool EventsTableModel::removeAll()

if (d->db->execute("DELETE FROM Events"))
{
QString location = QStandardPaths::writableLocation(QStandardPaths::DataLocation) %
QLatin1String("/data");

QDir dir(location);
QDir dir(Settings().outputLocation());

QStringList files = dir.entryList(QDir::Files | QDir::NoDotAndDotDot);

Expand Down

0 comments on commit ef23979

Please sign in to comment.