<label context="@label">Should the view properties used for all directories</label>
<default>false</default>
</entry>
+ <entry name="BrowseThroughArchives" type="Bool">
+ <label context="@label">Browse through archives</label>
+ <default>false</default>
+ </entry>
<entry name="ViewPropsTimestamp" type="DateTime" >
<label context="@label">Timestamp since when the view properties are valid</label>
</entry>
if (item.isDir()) {
m_view->setUrl(url);
- } else if (item.isFile() && url.isLocalFile()) {
- // allow to browse through ZIP and tar files
- // TODO: make this configurable for Dolphin in KDE 4.1
+ return;
+ }
+ const GeneralSettings* settings = DolphinSettings::instance().generalSettings();
+ const bool browseThroughArchives = settings->browseThroughArchives() &&
+ item.isFile() && url.isLocalFile();
+ if (browseThroughArchives) {
KMimeType::Ptr mime = item.mimeTypePtr();
// Don't use mime->is("application/zip"), as this would
if (mime->name() == "application/zip") {
url.setProtocol("zip");
m_view->setUrl(url);
- } else if (mime->is("application/x-tar") ||
- mime->is("application/x-tarz") ||
- mime->is("application/x-bzip-compressed-tar") ||
- mime->is("application/x-compressed-tar") ||
- mime->is("application/x-tzo")) {
+ return;
+ }
+
+ if (mime->is("application/x-tar") ||
+ mime->is("application/x-tarz") ||
+ mime->is("application/x-bzip-compressed-tar") ||
+ mime->is("application/x-compressed-tar") ||
+ mime->is("application/x-tzo")) {
url.setProtocol("tar");
m_view->setUrl(url);
- } else {
- item.run();
+ return;
}
- } else {
- item.run();
}
+
+ item.run();
}
#include "dolphinviewcontainer.moc"
m_filterBar(0),
m_showDeleteCommand(0),
m_confirmMoveToTrash(0),
- m_confirmDelete(0)
+ m_confirmDelete(0),
+ m_browseThroughArchives(0)
{
const int spacing = KDialog::spacingHint();
// create 'Show the command 'Delete' in context menu' checkbox
m_showDeleteCommand = new QCheckBox(i18nc("@option:check", "Show 'Delete' command in context menu"), vBox);
+ m_browseThroughArchives = new QCheckBox(i18nc("option:check", "Browse through archives"), vBox);
+
// Add a dummy widget with no restriction regarding
// a vertical resizing. This assures that the dialog layout
// is not stretched vertically.
KConfigGroup kdeConfig(KGlobal::config(), "KDE");
kdeConfig.writeEntry("ShowDeleteCommand", m_showDeleteCommand->isChecked());
kdeConfig.sync();
+
+ settings->setBrowseThroughArchives(m_browseThroughArchives->isChecked());
}
void GeneralSettingsPage::restoreDefaults()
const KConfigGroup kdeConfig(KGlobal::config(), "KDE");
m_showDeleteCommand->setChecked(kdeConfig.readEntry("ShowDeleteCommand", false));
+
+ m_browseThroughArchives->setChecked(settings->browseThroughArchives());
}
#include "generalsettingspage.moc"
QCheckBox* m_showDeleteCommand;
QCheckBox* m_confirmMoveToTrash;
QCheckBox* m_confirmDelete;
+
+ QCheckBox* m_browseThroughArchives;
};
#endif