~ubuntu-branches/ubuntu/quantal/ark/quantal

« back to all changes in this revision

Viewing changes to kerfuffle/archiveinterface.cpp

  • Committer: Package Import Robot
  • Author(s): Felix Geyer
  • Date: 2012-06-06 18:50:49 UTC
  • mfrom: (1.1.7)
  • Revision ID: package-import@ubuntu.com-20120606185049-z43lsy5wwp3wtrgt
Tags: 4:4.8.80-0ubuntu1
* Merge with Debian git repository, remaining changes:
  - Suggest instead of recommend p7zip-full
  - Add and install utilities-file-archiver.xpm
* New upstream beta release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
2
 * Copyright (c) 2007 Henrique Pinto <henrique.pinto@kdemail.net>
3
3
 * Copyright (c) 2008-2009 Harald Hvaal <haraldhv@stud.ntnu.no>
 
4
 * Copyright (c) 2009-2012 Raphael Kubo da Costa <rakuco@FreeBSD.org>
4
5
 *
5
6
 * Redistribution and use in source and binary forms, with or without
6
7
 * modification, are permitted provided that the following conditions
25
26
 */
26
27
 
27
28
#include "archiveinterface.h"
28
 
#include "observer.h"
29
29
#include <kdebug.h>
30
30
#include <kfileitem.h>
31
31
 
60
60
    return true;
61
61
}
62
62
 
63
 
void ReadOnlyArchiveInterface::setPassword(QString password)
 
63
void ReadOnlyArchiveInterface::setPassword(const QString &password)
64
64
{
65
65
    m_password = password;
66
66
}
70
70
    return m_password;
71
71
}
72
72
 
73
 
void ReadOnlyArchiveInterface::error(const QString & message, const QString & details)
74
 
{
75
 
    foreach(ArchiveObserver *observer, m_observers) {
76
 
        observer->onError(message, details);
77
 
    }
78
 
}
79
 
 
80
 
void ReadOnlyArchiveInterface::entry(const ArchiveEntry & archiveEntry)
81
 
{
82
 
    foreach(ArchiveObserver *observer, m_observers) {
83
 
        observer->onEntry(archiveEntry);
84
 
    }
85
 
}
86
 
 
87
 
void ReadOnlyArchiveInterface::entryRemoved(const QString & path)
88
 
{
89
 
    foreach(ArchiveObserver *observer, m_observers) {
90
 
        observer->onEntryRemoved(path);
91
 
    }
92
 
}
93
 
 
94
 
void ReadOnlyArchiveInterface::progress(double p)
95
 
{
96
 
    foreach(ArchiveObserver *observer, m_observers) {
97
 
        observer->onProgress(p);
98
 
    }
99
 
}
100
 
 
101
 
void ReadOnlyArchiveInterface::info(const QString& info)
102
 
{
103
 
    foreach(ArchiveObserver *observer, m_observers) {
104
 
        observer->onInfo(info);
105
 
    }
106
 
}
107
 
 
108
 
void ReadOnlyArchiveInterface::finished(bool result)
109
 
{
110
 
    foreach(ArchiveObserver *observer, m_observers) {
111
 
        observer->onFinished(result);
112
 
    }
113
 
}
114
 
 
115
73
bool ReadOnlyArchiveInterface::doKill()
116
74
{
117
75
    //default implementation
130
88
    return false;
131
89
}
132
90
 
133
 
void ReadOnlyArchiveInterface::userQuery(Query *query)
134
 
{
135
 
    foreach(ArchiveObserver *observer, m_observers) {
136
 
        observer->onUserQuery(query);
137
 
    }
138
 
}
139
 
 
140
 
void ReadOnlyArchiveInterface::registerObserver(ArchiveObserver *observer)
141
 
{
142
 
    m_observers.append(observer);
143
 
}
144
 
 
145
 
void ReadOnlyArchiveInterface::removeObserver(ArchiveObserver *observer)
146
 
{
147
 
    m_observers.removeAll(observer);
148
 
}
149
 
 
150
91
ReadWriteArchiveInterface::ReadWriteArchiveInterface(QObject *parent, const QVariantList & args)
151
92
        : ReadOnlyArchiveInterface(parent, args)
152
93
{