mirror of
https://bitbucket.org/smil3y/kdelibs.git
synced 2025-02-24 02:42:48 +00:00
kutils: check if the leading directory is writable from KArchive constructor
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
95162630d4
commit
720e62b6f1
1 changed files with 8 additions and 9 deletions
|
@ -421,16 +421,15 @@ KArchive::KArchive(const QString &path)
|
|||
return;
|
||||
}
|
||||
|
||||
if (QFile::exists(path)) {
|
||||
const KMimeType::Ptr kmimetype = KMimeType::findByPath(path);
|
||||
if (kmimetype) {
|
||||
if (s_writemimetypes.contains(kmimetype->name())) {
|
||||
d->m_writable = true;
|
||||
}
|
||||
d->m_writable = QFileInfo(QFileInfo(path).path()).isWritable();
|
||||
const KMimeType::Ptr kmimetype = KMimeType::findByPath(path);
|
||||
if (kmimetype) {
|
||||
if (!s_writemimetypes.contains(kmimetype->name())) {
|
||||
d->m_writable = false;
|
||||
}
|
||||
} else {
|
||||
// TODO: check if the leading directory is writable
|
||||
d->m_writable = true;
|
||||
}
|
||||
if (!d->m_writable) {
|
||||
d->m_error = i18n("Archive is not writable");
|
||||
}
|
||||
#else
|
||||
d->m_error = QString::fromLatin1("Built without LibArchive");
|
||||
|
|
Loading…
Add table
Reference in a new issue