diff --git a/part/part.cpp b/part/part.cpp --- a/part/part.cpp +++ b/part/part.cpp @@ -964,25 +964,29 @@ void Part::slotOpenEntry(int mode) { - qCDebug(ARK) << "Opening with mode" << mode; - QModelIndex index = m_filterModel->mapToSource(m_view->selectionModel()->currentIndex()); Archive::Entry *entry = m_model->entryForIndex(index); // Don't open directories. if (entry->isDir()) { return; } + // Don't open files bigger than the size limit. + const int maxPreviewSize = ArkSettings::previewFileSizeLimit() * 1024 * 1024; + if (ArkSettings::limitPreviewFileSize() && entry->property("size").toLongLong() >= maxPreviewSize) { + return; + } + // We don't support opening symlinks. if (!entry->property("link").toString().isEmpty()) { displayMsgWidget(KMessageWidget::Information, i18n("Ark cannot open symlinks.")); return; } // Extract the entry. if (!entry->fullPath().isEmpty()) { - + qCDebug(ARK) << "Opening with mode" << mode; m_openFileMode = static_cast(mode); KJob *job = nullptr;