mirror of
https://bitbucket.org/smil3y/kde-extraapps.git
synced 2025-02-23 18:32:53 +00:00
ark: implement isReadOnly() for libarchive plugin
now the interface will properly indicate that the archive is not writable when that is the case (it was not even before the port to KArchive) Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
4aaa9bbe6e
commit
b024821c56
3 changed files with 11 additions and 3 deletions
|
@ -168,10 +168,10 @@ bool ReadWriteArchiveInterface::isReadOnly() const
|
|||
{
|
||||
QFileInfo fileInfo(filename());
|
||||
if (fileInfo.exists()) {
|
||||
return ! fileInfo.isWritable();
|
||||
} else {
|
||||
return !fileInfo.dir().exists(); // TODO: Should also check if we can create a file in that directory
|
||||
return !fileInfo.isWritable();
|
||||
}
|
||||
// TODO: Should also check if we can create a file in that directory
|
||||
return !fileInfo.dir().exists();
|
||||
}
|
||||
|
||||
} // namespace Kerfuffle
|
||||
|
|
|
@ -236,6 +236,12 @@ bool LibArchiveInterface::deleteFiles(const QVariantList &files)
|
|||
return true;
|
||||
}
|
||||
|
||||
bool LibArchiveInterface::isReadOnly() const
|
||||
{
|
||||
KArchive karchive(filename());
|
||||
return !karchive.isWritable();
|
||||
}
|
||||
|
||||
void LibArchiveInterface::emitProgress(const qreal value)
|
||||
{
|
||||
emit progress(value);
|
||||
|
|
|
@ -45,6 +45,8 @@ public:
|
|||
bool addFiles(const QStringList& files, const CompressionOptions &options) final;
|
||||
bool deleteFiles(const QVariantList& files) final;
|
||||
|
||||
bool isReadOnly() const final;
|
||||
|
||||
private Q_SLOTS:
|
||||
void emitProgress(const qreal value);
|
||||
};
|
||||
|
|
Loading…
Add table
Reference in a new issue