Added support for xz archives. This resolve bug 2516.

Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
feat/lzip-support
Michele Calgaro 9 years ago
parent 76ca48c43d
commit 50e51d1622

@ -16,7 +16,7 @@
***************************************************************************/ ***************************************************************************/
/* This file is heavily based on ktar.cpp from tdelibs (c) David Faure */ /* This file is heavily based on ktar.cpp from tdelibs (c) David Faure */
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <time.h> #include <time.h>
@ -125,6 +125,8 @@ KIso::KIso( const TQString& filename, const TQString & _mimetype )
mimetype = "application/x-gzip"; mimetype = "application/x-gzip";
else if ( mimetype == "application/x-tbz" ) // that's a bzipped2 tar file, so ask for bz2 filter else if ( mimetype == "application/x-tbz" ) // that's a bzipped2 tar file, so ask for bz2 filter
mimetype = "application/x-bzip2"; mimetype = "application/x-bzip2";
else if ( mimetype == "application/x-txz" ) // that's a xzipped tar file, so ask for xz filter
mimetype = "application/x-xz";
else else
{ {
// Something else. Check if it's not really gzip though (e.g. for KOffice docs) // Something else. Check if it's not really gzip though (e.g. for KOffice docs)
@ -144,6 +146,14 @@ KIso::KIso( const TQString& filename, const TQString & _mimetype )
if ( fourthByte == 4 ) if ( fourthByte == 4 )
mimetype = "application/x-zip"; mimetype = "application/x-zip";
} }
else if ( firstByte == 0xfd && secondByte == '7' && thirdByte == 'z' )
{
unsigned char fourthByte = file.getch();
unsigned char fifthByte = file.getch();
unsigned char sixthByte = file.getch();
if ( fourthByte == 'X' && fifthByte == 'Z' && sixthByte == 0)
mimetype = "application/x-xz";
}
} }
} }
forced = false; forced = false;
@ -160,8 +170,8 @@ void KIso::prepareDevice( const TQString & filename,
setDevice( new QFileHack( filename ) ); setDevice( new QFileHack( filename ) );
else else
{ {
if( "application/x-gzip" == mimetype if("application/x-gzip" == mimetype || "application/x-bzip2" == mimetype ||
|| "application/x-bzip2" == mimetype) "application/x-xz" == mimetype)
forced = true; forced = true;
TQIODevice *dev = KFilterDev::deviceForFile( filename, mimetype, forced ); TQIODevice *dev = KFilterDev::deviceForFile( filename, mimetype, forced );
@ -294,7 +304,7 @@ void KIso::addBoot(struct el_torito_boot_descriptor* bootdesc) {
boot_entry *be; boot_entry *be;
TQString path; TQString path;
KIsoFile *entry; KIsoFile *entry;
entry=new KIsoFile( this, "Catalog", dirent->permissions() & ~S_IFDIR, entry=new KIsoFile( this, "Catalog", dirent->permissions() & ~S_IFDIR,
dirent->date(), dirent->adate(), dirent->cdate(), dirent->date(), dirent->adate(), dirent->cdate(),
dirent->user(), dirent->group(), TQString(), dirent->user(), dirent->group(), TQString(),
@ -326,7 +336,7 @@ void KIso::readParams()
TDEConfig *config; TDEConfig *config;
config = new TDEConfig("tdeio_isorc"); config = new TDEConfig("tdeio_isorc");
showhidden=config->readBoolEntry("showhidden",false); showhidden=config->readBoolEntry("showhidden",false);
showrr=config->readBoolEntry("showrr",true); showrr=config->readBoolEntry("showrr",true);
delete config; delete config;
@ -372,7 +382,7 @@ bool KIso::openArchive( int mode )
if (trackno==0) trackno=1; if (trackno==0) trackno=1;
for (i=0;i<trackno;i++) { for (i=0;i<trackno;i++) {
c_b=1;c_i=1;c_j=1; c_b=1;c_i=1;c_j=1;
root=rootDir(); root=rootDir();
if (trackno>1) { if (trackno>1) {
path=TQString(); path=TQString();
@ -396,11 +406,11 @@ bool KIso::openArchive( int mode )
if ( !memcmp(EL_TORITO_ID,bootdesc->system_id,ISODCL(8,39)) ) { if ( !memcmp(EL_TORITO_ID,bootdesc->system_id,ISODCL(8,39)) ) {
path="El Torito Boot"; path="El Torito Boot";
if (c_b>1) path += " (" + TQString::number(c_b) + ")"; if (c_b>1) path += " (" + TQString::number(c_b) + ")";
dirent = new KIsoDirectory( this, path, access | S_IFDIR, dirent = new KIsoDirectory( this, path, access | S_IFDIR,
buf.st_mtime, buf.st_atime, buf.st_ctime, uid, gid, TQString() ); buf.st_mtime, buf.st_atime, buf.st_ctime, uid, gid, TQString() );
root->addEntry(dirent); root->addEntry(dirent);
addBoot(bootdesc); addBoot(bootdesc);
c_b++; c_b++;
} }

File diff suppressed because it is too large Load Diff

@ -5,10 +5,10 @@
e-mail : krusader@users.sourceforge.net e-mail : krusader@users.sourceforge.net
web site : http://krusader.sourceforge.net web site : http://krusader.sourceforge.net
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
Description Description
*************************************************************************** ***************************************************************************
A A
db dD d8888b. db db .d8888. .d8b. d8888b. d88888b d8888b. db dD d8888b. db db .d8888. .d8b. d8888b. d88888b d8888b.
88 ,8P' 88 `8D 88 88 88' YP d8' `8b 88 `8D 88' 88 `8D 88 ,8P' 88 `8D 88 88 88' YP d8' `8b 88 `8D 88' 88 `8D
@ -63,11 +63,13 @@ PackGUI::PackGUI(TQString defaultName, TQString defaultPath, int noOfFiles, TQSt
if (PS("tar")) typeData->insertItem("tar"); if (PS("tar")) typeData->insertItem("tar");
if (PS("tar") && PS("gzip")) typeData->insertItem("tar.gz"); if (PS("tar") && PS("gzip")) typeData->insertItem("tar.gz");
if (PS("tar") && PS("bzip2")) typeData->insertItem("tar.bz2"); if (PS("tar") && PS("bzip2")) typeData->insertItem("tar.bz2");
if (PS("tar") && PS("xz")) typeData->insertItem("tar.xz");
if (PS("zip")) typeData->insertItem("zip"); if (PS("zip")) typeData->insertItem("zip");
if (PS("rar")) typeData->insertItem("rar"); if (PS("rar")) typeData->insertItem("rar");
if (PS("lha")) typeData->insertItem("lha"); if (PS("lha")) typeData->insertItem("lha");
if (PS("arj")) typeData->insertItem("arj"); if (PS("arj")) typeData->insertItem("arj");
if (PS("7z")) typeData->insertItem("7z"); if (PS("7z")) typeData->insertItem("7z");
if (PS("xz")) typeData->insertItem("xz");
// set the last used packer as the top one // set the last used packer as the top one
TQString tmp=krConfig->readEntry("lastUsedPacker",TQString()); TQString tmp=krConfig->readEntry("lastUsedPacker",TQString());
if (tmp!=TQString()) { if (tmp!=TQString()) {

@ -66,10 +66,11 @@ KgArchives::KgArchives( bool first, TQWidget* parent, const char* name ) :
{"Archives","Do UnAce", _DoUnAce, i18n( "Ace" ), false, ""}, {"Archives","Do UnAce", _DoUnAce, i18n( "Ace" ), false, ""},
{"Archives","Do Lha", _DoLha, i18n( "Lha" ), false, ""}, {"Archives","Do Lha", _DoLha, i18n( "Lha" ), false, ""},
{"Archives","Do DEB", _DoDEB, i18n( "Deb" ), false, ""}, {"Archives","Do DEB", _DoDEB, i18n( "Deb" ), false, ""},
{"Archives","Do 7z", _Do7z, i18n( "7zip" ), false, ""} {"Archives","Do 7z", _Do7z, i18n( "7zip" ), false, ""},
{"Archives","Do Xz", _DoXz, i18n( "Xz" ), false, ""}
}; };
cbs = createCheckBoxGroup( 3, 0, packers, 11, generalGrp ); cbs = createCheckBoxGroup( 3, 0, packers, 12, generalGrp );
generalGrid->addWidget( cbs, 1, 0 ); generalGrid->addWidget( cbs, 1, 0 );
addLabel( generalGrid, 2, 0, i18n( "The archives that are \"greyed-out\" were unavailable on your\nsystem last time Krusader checked. If you wish Krusader to\nsearch again, click the 'Auto Configure' button." ), addLabel( generalGrid, 2, 0, i18n( "The archives that are \"greyed-out\" were unavailable on your\nsystem last time Krusader checked. If you wish Krusader to\nsearch again, click the 'Auto Configure' button." ),
@ -81,7 +82,7 @@ KgArchives::KgArchives( bool first, TQWidget* parent, const char* name ) :
createSpacer( hbox, "spacer2" ); createSpacer( hbox, "spacer2" );
generalGrid->addWidget( hbox, 3, 0 ); generalGrid->addWidget( hbox, 3, 0 );
connect( btnAutoConfigure, TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotAutoConfigure() ) ); connect( btnAutoConfigure, TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotAutoConfigure() ) );
kgArchivesLayout->addWidget( generalGrp, 0 ,0 ); kgArchivesLayout->addWidget( generalGrp, 0 ,0 );
// ------------------------ FINE-TUNING GROUPBOX -------------------------------- // ------------------------ FINE-TUNING GROUPBOX --------------------------------
@ -101,7 +102,7 @@ KgArchives::KgArchives( bool first, TQWidget* parent, const char* name ) :
fineTuneGrid->addWidget( finetunes, 1, 0 ); fineTuneGrid->addWidget( finetunes, 1, 0 );
kgArchivesLayout->addWidget( fineTuneGrp, 1 ,0 ); kgArchivesLayout->addWidget( fineTuneGrp, 1 ,0 );
if( first ) if( first )
slotAutoConfigure(); slotAutoConfigure();
@ -133,6 +134,7 @@ void KgArchives::disableNonExistingPackers()
cbs->find( "Do Unarj" )->setEnabled(PS("unarj") || PS("arj") ); cbs->find( "Do Unarj" )->setEnabled(PS("unarj") || PS("arj") );
cbs->find( "Do DEB" )->setEnabled(PS("dpkg") && PS("tar") ); cbs->find( "Do DEB" )->setEnabled(PS("dpkg") && PS("tar") );
cbs->find( "Do 7z" )->setEnabled( PS("7z") ); cbs->find( "Do 7z" )->setEnabled( PS("7z") );
cbs->find( "Do Xz" )->setEnabled(PS("xz"));
krConfig->setGroup( "Archives" ); krConfig->setGroup( "Archives" );
krConfig->writeEntry( "Supported Packers", lst ); krConfig->writeEntry( "Supported Packers", lst );

@ -56,7 +56,7 @@ KgDependencies::KgDependencies( bool first, TQWidget* parent, const char* name
pathsGrid->setSpacing( 6 ); pathsGrid->setSpacing( 6 );
pathsGrid->setMargin( 11 ); pathsGrid->setMargin( 11 );
pathsGrid->setAlignment( TQt::AlignTop ); pathsGrid->setAlignment( TQt::AlignTop );
addApplication( "df", pathsGrid, 0, general_tab, PAGE_GENERAL ); addApplication( "df", pathsGrid, 0, general_tab, PAGE_GENERAL );
addApplication( "eject", pathsGrid, 1, general_tab, PAGE_GENERAL ); addApplication( "eject", pathsGrid, 1, general_tab, PAGE_GENERAL );
addApplication( "tdesu", pathsGrid, 2, general_tab, PAGE_GENERAL ); addApplication( "tdesu", pathsGrid, 2, general_tab, PAGE_GENERAL );
@ -93,6 +93,7 @@ KgDependencies::KgDependencies( bool first, TQWidget* parent, const char* name
addApplication( "unrar", archGrid1,11, packers_tab, PAGE_PACKERS ); addApplication( "unrar", archGrid1,11, packers_tab, PAGE_PACKERS );
addApplication( "unzip", archGrid1,12, packers_tab, PAGE_PACKERS ); addApplication( "unzip", archGrid1,12, packers_tab, PAGE_PACKERS );
addApplication( "zip", archGrid1,13, packers_tab, PAGE_PACKERS ); addApplication( "zip", archGrid1,13, packers_tab, PAGE_PACKERS );
addApplication( "xz", archGrid1,14, packers_tab, PAGE_PACKERS );
// ---------------------------- CHECKSUM TAB ------------------------------------- // ---------------------------- CHECKSUM TAB -------------------------------------
TQWidget *checksum_tab = new TQWidget( tabWidget, "tab_4" ); TQWidget *checksum_tab = new TQWidget( tabWidget, "tab_4" );

@ -44,7 +44,7 @@
KgGeneral::KgGeneral( bool first, TQWidget* parent, const char* name ) : KgGeneral::KgGeneral( bool first, TQWidget* parent, const char* name ) :
KonfiguratorPage( first, parent, name ) KonfiguratorPage( first, parent, name )
{ {
if( first ) if( first )
slotFindTools(); slotFindTools();
TQGridLayout *kgGeneralLayout = new TQGridLayout( parent ); TQGridLayout *kgGeneralLayout = new TQGridLayout( parent );
@ -91,11 +91,11 @@ TQFrame *line2 = createLine( generalGrp, "line2" );
TQVBox * vbox = new TQVBox( hbox2 ); TQVBox * vbox = new TQVBox( hbox2 );
new TQLabel( i18n("Default viewer mode:"), vbox); new TQLabel( i18n("Default viewer mode:"), vbox);
KONFIGURATOR_NAME_VALUE_TIP viewMode[] = KONFIGURATOR_NAME_VALUE_TIP viewMode[] =
// name value tooltip // name value tooltip
{{ i18n( "Generic mode" ), "generic", i18n( "Use the system's default viewer" ) }, {{ i18n( "Generic mode" ), "generic", i18n( "Use the system's default viewer" ) },
{ i18n( "Text mode" ), "text", i18n( "View the file in text-only mode" ) }, { i18n( "Text mode" ), "text", i18n( "View the file in text-only mode" ) },
{ i18n( "Hex mode" ), "hex", i18n( "View the file in hex-mode (better for binary files)" ) } }; { i18n( "Hex mode" ), "hex", i18n( "View the file in hex-mode (better for binary files)" ) } };
createRadioButtonGroup( "General", "Default Viewer Mode", createRadioButtonGroup( "General", "Default Viewer Mode",
"generic", 0, 3, viewMode, 3, vbox, "myRadio2", false ); "generic", 0, 3, viewMode, 3, vbox, "myRadio2", false );
@ -132,8 +132,9 @@ TQFrame *line2 = createLine( generalGrp, "line2" );
defaultAtomicExtensions += ".tar.gz"; defaultAtomicExtensions += ".tar.gz";
defaultAtomicExtensions += ".tar.bz2"; defaultAtomicExtensions += ".tar.bz2";
defaultAtomicExtensions += ".moc.cpp"; defaultAtomicExtensions += ".moc.cpp";
defaultAtomicExtensions += ".tar.xz";
listBox = createListBox( "Look&Feel", "Atomic Extensions", listBox = createListBox( "Look&Feel", "Atomic Extensions",
defaultAtomicExtensions, vbox2, true, false ); defaultAtomicExtensions, vbox2, true, false );
TQFrame *line3 = createLine( generalGrp, "line3" ); TQFrame *line3 = createLine( generalGrp, "line3" );

@ -51,10 +51,11 @@ TQString KgProtocols::defaultKrarcMimes = "application/x-7z,application/x-7z-com
"application/x-lha,application/x-lha-compressed," "application/x-lha,application/x-lha-compressed,"
"application/x-rar,application/x-rar-compressed," "application/x-rar,application/x-rar-compressed,"
"application/x-rpm," "application/x-rpm,"
"application/x-xz,"
"application/x-zip,application/x-zip-compressed"; "application/x-zip,application/x-zip-compressed";
TQString KgProtocols::defaultTarMimes = "application/x-tar,application/x-tarz," TQString KgProtocols::defaultTarMimes = "application/x-tar,application/x-tarz,"
"application/x-compressed-tar," "application/x-compressed-tar,"
"application/x-tbz,application/x-tgz"; "application/x-tbz,application/x-tgz,application/x-txz";
KgProtocols::KgProtocols( bool first, TQWidget* parent, const char* name ) : KgProtocols::KgProtocols( bool first, TQWidget* parent, const char* name ) :
KonfiguratorPage( first, parent, name ) KonfiguratorPage( first, parent, name )
@ -63,22 +64,22 @@ KgProtocols::KgProtocols( bool first, TQWidget* parent, const char* name ) :
KgProtocolsLayout->setSpacing( 6 ); KgProtocolsLayout->setSpacing( 6 );
// -------------------------- LINK VIEW ---------------------------------- // -------------------------- LINK VIEW ----------------------------------
TQGroupBox *linkGrp = createFrame( i18n( "Links" ), parent, "linkGrp" ); TQGroupBox *linkGrp = createFrame( i18n( "Links" ), parent, "linkGrp" );
TQGridLayout *linkGrid = createGridLayout( linkGrp->layout() ); TQGridLayout *linkGrid = createGridLayout( linkGrp->layout() );
linkList = new TQListView( linkGrp, "linkList" ); linkList = new TQListView( linkGrp, "linkList" );
linkList->addColumn( i18n( "Defined Links" ) ); linkList->addColumn( i18n( "Defined Links" ) );
linkList->header()->setStretchEnabled( true, 0 ); linkList->header()->setStretchEnabled( true, 0 );
linkList->setRootIsDecorated( true ); linkList->setRootIsDecorated( true );
linkGrid->addWidget( linkList, 0, 0 ); linkGrid->addWidget( linkList, 0, 0 );
KgProtocolsLayout->addMultiCellWidget( linkGrp, 0 ,1, 0, 0 ); KgProtocolsLayout->addMultiCellWidget( linkGrp, 0 ,1, 0, 0 );
// -------------------------- BUTTONS ---------------------------------- // -------------------------- BUTTONS ----------------------------------
TQVBox *vbox1 = new TQVBox( parent, "vbox1" ) ; TQVBox *vbox1 = new TQVBox( parent, "vbox1" ) ;
addSpacer( vbox1 ); addSpacer( vbox1 );
btnAddProtocol = new TQPushButton( vbox1, "btnAddProtocolButton" ); btnAddProtocol = new TQPushButton( vbox1, "btnAddProtocolButton" );
btnAddProtocol->setPixmap( krLoader->loadIcon( "1leftarrow", TDEIcon::Small ) ); btnAddProtocol->setPixmap( krLoader->loadIcon( "1leftarrow", TDEIcon::Small ) );
@ -87,11 +88,11 @@ KgProtocols::KgProtocols( bool first, TQWidget* parent, const char* name ) :
btnRemoveProtocol->setPixmap( krLoader->loadIcon( "1rightarrow", TDEIcon::Small ) ); btnRemoveProtocol->setPixmap( krLoader->loadIcon( "1rightarrow", TDEIcon::Small ) );
TQWhatsThis::add( btnRemoveProtocol, i18n( "Remove protocol from the link list." ) ); TQWhatsThis::add( btnRemoveProtocol, i18n( "Remove protocol from the link list." ) );
addSpacer( vbox1 ); addSpacer( vbox1 );
KgProtocolsLayout->addWidget( vbox1, 0 ,1 ); KgProtocolsLayout->addWidget( vbox1, 0 ,1 );
TQVBox *vbox2 = new TQVBox( parent, "vbox2" ) ; TQVBox *vbox2 = new TQVBox( parent, "vbox2" ) ;
addSpacer( vbox2 ); addSpacer( vbox2 );
btnAddMime = new TQPushButton( vbox2, "btnAddMimeButton" ); btnAddMime = new TQPushButton( vbox2, "btnAddMimeButton" );
btnAddMime->setPixmap( krLoader->loadIcon( "1leftarrow", TDEIcon::Small ) ); btnAddMime->setPixmap( krLoader->loadIcon( "1leftarrow", TDEIcon::Small ) );
@ -100,14 +101,14 @@ KgProtocols::KgProtocols( bool first, TQWidget* parent, const char* name ) :
btnRemoveMime->setPixmap( krLoader->loadIcon( "1rightarrow", TDEIcon::Small ) ); btnRemoveMime->setPixmap( krLoader->loadIcon( "1rightarrow", TDEIcon::Small ) );
TQWhatsThis::add( btnRemoveMime, i18n( "Remove mime from the link list." ) ); TQWhatsThis::add( btnRemoveMime, i18n( "Remove mime from the link list." ) );
addSpacer( vbox2 ); addSpacer( vbox2 );
KgProtocolsLayout->addWidget( vbox2, 1 ,1 ); KgProtocolsLayout->addWidget( vbox2, 1 ,1 );
// -------------------------- PROTOCOLS LISTBOX ---------------------------------- // -------------------------- PROTOCOLS LISTBOX ----------------------------------
TQGroupBox *protocolGrp = createFrame( i18n( "Protocols" ), parent, "protocolGrp" ); TQGroupBox *protocolGrp = createFrame( i18n( "Protocols" ), parent, "protocolGrp" );
TQGridLayout *protocolGrid = createGridLayout( protocolGrp->layout() ); TQGridLayout *protocolGrid = createGridLayout( protocolGrp->layout() );
protocolList = new TQListBox( protocolGrp, "protocolList" ); protocolList = new TQListBox( protocolGrp, "protocolList" );
loadListCapableProtocols(); loadListCapableProtocols();
protocolGrid->addWidget( protocolList, 0, 0 ); protocolGrid->addWidget( protocolList, 0, 0 );
@ -116,17 +117,17 @@ KgProtocols::KgProtocols( bool first, TQWidget* parent, const char* name ) :
// -------------------------- MIMES LISTBOX ---------------------------------- // -------------------------- MIMES LISTBOX ----------------------------------
TQGroupBox *mimeGrp = createFrame( i18n( "Mimes" ), parent, "mimeGrp" ); TQGroupBox *mimeGrp = createFrame( i18n( "Mimes" ), parent, "mimeGrp" );
TQGridLayout *mimeGrid = createGridLayout( mimeGrp->layout() ); TQGridLayout *mimeGrid = createGridLayout( mimeGrp->layout() );
mimeList = new TQListBox( mimeGrp, "protocolList" ); mimeList = new TQListBox( mimeGrp, "protocolList" );
loadMimes(); loadMimes();
mimeGrid->addWidget( mimeList, 0, 0 ); mimeGrid->addWidget( mimeList, 0, 0 );
KgProtocolsLayout->addWidget( mimeGrp, 1 ,2 ); KgProtocolsLayout->addWidget( mimeGrp, 1 ,2 );
// -------------------------- CONNECT TABLE ---------------------------------- // -------------------------- CONNECT TABLE ----------------------------------
connect( protocolList, TQT_SIGNAL( selectionChanged() ), this, TQT_SLOT( slotDisableButtons() ) ); connect( protocolList, TQT_SIGNAL( selectionChanged() ), this, TQT_SLOT( slotDisableButtons() ) );
connect( linkList, TQT_SIGNAL( selectionChanged() ), this, TQT_SLOT( slotDisableButtons() ) ); connect( linkList, TQT_SIGNAL( selectionChanged() ), this, TQT_SLOT( slotDisableButtons() ) );
connect( mimeList, TQT_SIGNAL( selectionChanged() ), this, TQT_SLOT( slotDisableButtons() ) ); connect( mimeList, TQT_SIGNAL( selectionChanged() ), this, TQT_SLOT( slotDisableButtons() ) );
@ -135,11 +136,11 @@ KgProtocols::KgProtocols( bool first, TQWidget* parent, const char* name ) :
connect( btnRemoveProtocol, TQT_SIGNAL( clicked() ) , this, TQT_SLOT( slotRemoveProtocol() ) ); connect( btnRemoveProtocol, TQT_SIGNAL( clicked() ) , this, TQT_SLOT( slotRemoveProtocol() ) );
connect( btnAddMime, TQT_SIGNAL( clicked() ) , this, TQT_SLOT( slotAddMime() ) ); connect( btnAddMime, TQT_SIGNAL( clicked() ) , this, TQT_SLOT( slotAddMime() ) );
connect( btnRemoveMime, TQT_SIGNAL( clicked() ) , this, TQT_SLOT( slotRemoveMime() ) ); connect( btnRemoveMime, TQT_SIGNAL( clicked() ) , this, TQT_SLOT( slotRemoveMime() ) );
loadInitialValues(); loadInitialValues();
slotDisableButtons(); slotDisableButtons();
} }
TQWidget* KgProtocols::addSpacer( TQWidget *parent, const char *widgetName ) TQWidget* KgProtocols::addSpacer( TQWidget *parent, const char *widgetName )
{ {
TQWidget *widget = new TQWidget( parent, widgetName ); TQWidget *widget = new TQWidget( parent, widgetName );
@ -153,8 +154,8 @@ void KgProtocols::loadListCapableProtocols()
{ {
TQStringList protocols = KProtocolInfo::protocols(); TQStringList protocols = KProtocolInfo::protocols();
protocols.sort(); protocols.sort();
for ( TQStringList::Iterator it = protocols.begin(); it != protocols.end();) for ( TQStringList::Iterator it = protocols.begin(); it != protocols.end();)
{ {
if( !KProtocolInfo::supportsListing( *it ) ) if( !KProtocolInfo::supportsListing( *it ) )
{ {
@ -169,10 +170,10 @@ void KgProtocols::loadListCapableProtocols()
void KgProtocols::loadMimes() void KgProtocols::loadMimes()
{ {
KMimeType::List mimes = KMimeType::allMimeTypes(); KMimeType::List mimes = KMimeType::allMimeTypes();
for( TQValueListIterator<KMimeType::Ptr> it = mimes.begin(); it != mimes.end(); it++ ) for( TQValueListIterator<KMimeType::Ptr> it = mimes.begin(); it != mimes.end(); it++ )
mimeList->insertItem( (*it)->name() ); mimeList->insertItem( (*it)->name() );
mimeList->sort(); mimeList->sort();
} }
@ -184,7 +185,7 @@ void KgProtocols::slotDisableButtons()
btnRemoveProtocol->setEnabled( isProtocolSelected ); btnRemoveProtocol->setEnabled( isProtocolSelected );
btnAddMime->setEnabled( listViewItem != 0 && mimeList->selectedItem() != 0 ); btnAddMime->setEnabled( listViewItem != 0 && mimeList->selectedItem() != 0 );
btnRemoveMime->setEnabled( listViewItem == 0 ? false : listViewItem->parent() != 0 ); btnRemoveMime->setEnabled( listViewItem == 0 ? false : listViewItem->parent() != 0 );
if( linkList->currentItem() == 0 && linkList->firstChild() != 0 ) if( linkList->currentItem() == 0 && linkList->firstChild() != 0 )
linkList->setCurrentItem( linkList->firstChild() ); linkList->setCurrentItem( linkList->firstChild() );
if( linkList->selectedItem() == 0 && linkList->currentItem() != 0 ) if( linkList->selectedItem() == 0 && linkList->currentItem() != 0 )
@ -210,7 +211,7 @@ void KgProtocols::addProtocol( TQString name, bool changeCurrent )
protocolList->removeItem( protocolList->index( item ) ); protocolList->removeItem( protocolList->index( item ) );
TQListViewItem *listViewItem = new TQListViewItem( linkList, name ); TQListViewItem *listViewItem = new TQListViewItem( linkList, name );
listViewItem->setPixmap( 0, krLoader->loadIcon( "application-x-executable", TDEIcon::Small ) ); listViewItem->setPixmap( 0, krLoader->loadIcon( "application-x-executable", TDEIcon::Small ) );
if( changeCurrent ) if( changeCurrent )
linkList->setCurrentItem( listViewItem ); linkList->setCurrentItem( listViewItem );
} }
@ -234,7 +235,7 @@ void KgProtocols::removeProtocol( TQString name )
{ {
while( item->childCount() != 0 ) while( item->childCount() != 0 )
removeMime( item->firstChild()->text( 0 ) ); removeMime( item->firstChild()->text( 0 ) );
linkList->takeItem( item ); linkList->takeItem( item );
protocolList->insertItem( name ); protocolList->insertItem( name );
protocolList->sort(); protocolList->sort();
@ -249,7 +250,7 @@ void KgProtocols::slotAddMime()
TQListViewItem *itemToAdd = linkList->currentItem(); TQListViewItem *itemToAdd = linkList->currentItem();
if( itemToAdd->parent() ) if( itemToAdd->parent() )
itemToAdd = itemToAdd->parent(); itemToAdd = itemToAdd->parent();
addMime( item->text(), itemToAdd->text( 0 ) ); addMime( item->text(), itemToAdd->text( 0 ) );
slotDisableButtons(); slotDisableButtons();
emit sigChanged(); emit sigChanged();
@ -260,7 +261,7 @@ void KgProtocols::addMime( TQString name, TQString protocol )
{ {
TQListBoxItem *item = mimeList->findItem( name, ExactMatch ); TQListBoxItem *item = mimeList->findItem( name, ExactMatch );
TQListViewItem *currentListItem = linkList->findItem( protocol, 0 ); TQListViewItem *currentListItem = linkList->findItem( protocol, 0 );
if( item && currentListItem && currentListItem->parent() == 0 ) if( item && currentListItem && currentListItem->parent() == 0 )
{ {
mimeList->removeItem( mimeList->index( item ) ); mimeList->removeItem( mimeList->index( item ) );
@ -284,7 +285,7 @@ void KgProtocols::slotRemoveMime()
void KgProtocols::removeMime( TQString name ) void KgProtocols::removeMime( TQString name )
{ {
TQListViewItem *currentMimeItem = linkList->findItem( name, 0 ); TQListViewItem *currentMimeItem = linkList->findItem( name, 0 );
if( currentMimeItem && currentMimeItem->parent() != 0 ) if( currentMimeItem && currentMimeItem->parent() != 0 )
{ {
mimeList->insertItem( currentMimeItem->text( 0 ) ); mimeList->insertItem( currentMimeItem->text( 0 ) );
@ -297,20 +298,20 @@ void KgProtocols::loadInitialValues()
{ {
while( linkList->childCount() != 0 ) while( linkList->childCount() != 0 )
removeProtocol( linkList->firstChild()->text( 0 ) ); removeProtocol( linkList->firstChild()->text( 0 ) );
krConfig->setGroup( "Protocols" ); krConfig->setGroup( "Protocols" );
TQStringList protList = krConfig->readListEntry( "Handled Protocols" ); TQStringList protList = krConfig->readListEntry( "Handled Protocols" );
for( TQStringList::Iterator it = protList.begin(); it != protList.end(); it++ ) for( TQStringList::Iterator it = protList.begin(); it != protList.end(); it++ )
{ {
addProtocol( *it ); addProtocol( *it );
TQStringList mimes = krConfig->readListEntry( TQString( "Mimes For %1" ).arg( *it ) ); TQStringList mimes = krConfig->readListEntry( TQString( "Mimes For %1" ).arg( *it ) );
for( TQStringList::Iterator it2 = mimes.begin(); it2 != mimes.end(); it2++ ) for( TQStringList::Iterator it2 = mimes.begin(); it2 != mimes.end(); it2++ )
addMime( *it2, *it ); addMime( *it2, *it );
} }
if( linkList->firstChild() != 0 ) if( linkList->firstChild() != 0 )
linkList->setCurrentItem( linkList->firstChild() ); linkList->setCurrentItem( linkList->firstChild() );
slotDisableButtons(); slotDisableButtons();
@ -320,22 +321,22 @@ void KgProtocols::setDefaults()
{ {
while( linkList->childCount() != 0 ) while( linkList->childCount() != 0 )
removeProtocol( linkList->firstChild()->text( 0 ) ); removeProtocol( linkList->firstChild()->text( 0 ) );
addProtocol( "iso" ); addProtocol( "iso" );
addMime( "application/x-iso", "iso" ); addMime( "application/x-iso", "iso" );
addProtocol( "krarc" ); addProtocol( "krarc" );
TQStringList krarcMimes = TQStringList::split( ',', defaultKrarcMimes ); TQStringList krarcMimes = TQStringList::split( ',', defaultKrarcMimes );
for( TQStringList::Iterator it = krarcMimes.begin(); it != krarcMimes.end(); it++ ) for( TQStringList::Iterator it = krarcMimes.begin(); it != krarcMimes.end(); it++ )
addMime( *it, "krarc" ); addMime( *it, "krarc" );
addProtocol( "tar" ); addProtocol( "tar" );
TQStringList tarMimes = TQStringList::split( ',', defaultTarMimes ); TQStringList tarMimes = TQStringList::split( ',', defaultTarMimes );
for( TQStringList::Iterator it = tarMimes.begin(); it != tarMimes.end(); it++ ) for( TQStringList::Iterator it = tarMimes.begin(); it != tarMimes.end(); it++ )
addMime( *it, "tar" ); addMime( *it, "tar" );
slotDisableButtons(); slotDisableButtons();
if( isChanged() ) if( isChanged() )
emit sigChanged(); emit sigChanged();
} }
@ -344,18 +345,18 @@ bool KgProtocols::isChanged()
{ {
krConfig->setGroup( "Protocols" ); krConfig->setGroup( "Protocols" );
TQStringList protList = krConfig->readListEntry( "Handled Protocols" ); TQStringList protList = krConfig->readListEntry( "Handled Protocols" );
if( (int)protList.count() != linkList->childCount() ) if( (int)protList.count() != linkList->childCount() )
return true; return true;
TQListViewItem *item = linkList->firstChild(); TQListViewItem *item = linkList->firstChild();
while( item ) while( item )
{ {
if( !protList.contains( item->text( 0 ) ) ) if( !protList.contains( item->text( 0 ) ) )
return true; return true;
TQStringList mimes = krConfig->readListEntry( TQString( "Mimes For %1" ).arg( item->text( 0 ) ) ); TQStringList mimes = krConfig->readListEntry( TQString( "Mimes For %1" ).arg( item->text( 0 ) ) );
if( (int)mimes.count() != item->childCount() ) if( (int)mimes.count() != item->childCount() )
return true; return true;
TQListViewItem *childs = item->firstChild(); TQListViewItem *childs = item->firstChild();
@ -365,24 +366,24 @@ bool KgProtocols::isChanged()
return true; return true;
childs = childs->nextSibling(); childs = childs->nextSibling();
} }
item = item->nextSibling(); item = item->nextSibling();
} }
return false; return false;
} }
bool KgProtocols::apply() bool KgProtocols::apply()
{ {
krConfig->setGroup( "Protocols" ); krConfig->setGroup( "Protocols" );
TQStringList protocolList; TQStringList protocolList;
TQListViewItem *item = linkList->firstChild(); TQListViewItem *item = linkList->firstChild();
while( item ) while( item )
{ {
protocolList.append( item->text( 0 ) ); protocolList.append( item->text( 0 ) );
TQStringList mimes; TQStringList mimes;
TQListViewItem *childs = item->firstChild(); TQListViewItem *childs = item->firstChild();
while( childs ) while( childs )
@ -391,15 +392,15 @@ bool KgProtocols::apply()
childs = childs->nextSibling(); childs = childs->nextSibling();
} }
krConfig->writeEntry( TQString( "Mimes For %1" ).arg( item->text( 0 ) ), mimes ); krConfig->writeEntry( TQString( "Mimes For %1" ).arg( item->text( 0 ) ), mimes );
item = item->nextSibling(); item = item->nextSibling();
} }
krConfig->writeEntry( "Handled Protocols", protocolList ); krConfig->writeEntry( "Handled Protocols", protocolList );
krConfig->sync(); krConfig->sync();
KrServices::clearProtocolCache(); KrServices::clearProtocolCache();
emit sigChanged(); emit sigChanged();
return false; return false;
} }

@ -99,20 +99,21 @@ KrArchiverResultTable::KrArchiverResultTable(TQWidget* parent)
{ {
_supported = KRarcHandler::supportedPackers(); // get list of available packers _supported = KRarcHandler::supportedPackers(); // get list of available packers
Archiver* tar = new Archiver("tar", "http://www.gnu.org", PS("tar"), true, true); Archiver* tar = new Archiver("tar", "http://www.gnu.org", PS("tar"), true, true);
Archiver* gzip = new Archiver("gzip", "http://www.gnu.org", PS("gzip"), true, true); Archiver* gzip = new Archiver("gzip", "http://www.gnu.org", PS("gzip"), true, true);
Archiver* bzip2 = new Archiver("bzip2", "http://www.gnu.org", PS("bzip2"), true, true); Archiver* bzip2 = new Archiver("bzip2", "http://www.gnu.org", PS("bzip2"), true, true);
Archiver* lha = new Archiver("lha", "http://www.gnu.org", PS("lha"), true, true); Archiver* lha = new Archiver("lha", "http://www.gnu.org", PS("lha"), true, true);
Archiver* zip = new Archiver("zip", "http://www.info-zip.org", PS("zip"), true, false); Archiver* zip = new Archiver("zip", "http://www.info-zip.org", PS("zip"), true, false);
Archiver* unzip = new Archiver("unzip", "http://www.info-zip.org", PS("unzip"), false, true); Archiver* unzip = new Archiver("unzip", "http://www.info-zip.org", PS("unzip"), false, true);
Archiver* arj = new Archiver("arj", "http://www.arjsoftware.com", PS("arj"), true, true); Archiver* arj = new Archiver("arj", "http://www.arjsoftware.com", PS("arj"), true, true);
Archiver* unarj = new Archiver("unarj", "http://www.arjsoftware.com", PS("unarj"), false, true); Archiver* unarj = new Archiver("unarj", "http://www.arjsoftware.com", PS("unarj"), false, true);
Archiver* unace = new Archiver("unace", "http://www.winace.com", PS("unace"), false, true); Archiver* unace = new Archiver("unace", "http://www.winace.com", PS("unace"), false, true);
Archiver* rar = new Archiver("rar", "http://www.rarsoft.com", PS("rar"), true, true); Archiver* rar = new Archiver("rar", "http://www.rarsoft.com", PS("rar"), true, true);
Archiver* unrar = new Archiver("unrar", "http://www.rarsoft.com", PS("unrar"), false, true); Archiver* unrar = new Archiver("unrar", "http://www.rarsoft.com", PS("unrar"), false, true);
Archiver* rpm = new Archiver("rpm", "http://www.gnu.org", PS("rpm"), false, true); Archiver* rpm = new Archiver("rpm", "http://www.gnu.org", PS("rpm"), false, true);
Archiver* dpkg = new Archiver("dpkg", "http://www.dpkg.org", PS("dpkg"), false, true); Archiver* dpkg = new Archiver("dpkg", "http://www.dpkg.org", PS("dpkg"), false, true);
Archiver* _7z = new Archiver("7z", "http://www.7-zip.org", PS("7z"), true, true); Archiver* _7z = new Archiver("7z", "http://www.7-zip.org", PS("7z"), true, true);
Archiver* xz = new Archiver("xz", "http://www.tukaani.org/xz", PS("xz"), true, true);
// Special case: arj can unpack, but unarj is prefered // Special case: arj can unpack, but unarj is prefered
if(PS("arj") && PS("unarj")) if(PS("arj") && PS("unarj"))
@ -149,6 +150,7 @@ KrArchiverResultTable::KrArchiverResultTable(TQWidget* parent)
addRow(rpm, _grid); addRow(rpm, _grid);
addRow(dpkg, _grid); addRow(dpkg, _grid);
addRow(_7z, _grid); addRow(_7z, _grid);
addRow(xz, _grid);
delete tar; delete tar;
delete gzip; delete gzip;
@ -164,6 +166,7 @@ KrArchiverResultTable::KrArchiverResultTable(TQWidget* parent)
delete rpm; delete rpm;
delete dpkg; delete dpkg;
delete _7z; delete _7z;
delete xz;
} }
KrArchiverResultTable::~KrArchiverResultTable() KrArchiverResultTable::~KrArchiverResultTable()

@ -42,7 +42,7 @@ YP YD 88 YD ~Y8888P' `8888Y' YP YP Y8888D' Y88888P 88 YD
#include <tqtooltip.h> #include <tqtooltip.h>
#define CANCEL_TWO_CLICK_RENAME {singleClicked = false;renameTimer.stop();} #define CANCEL_TWO_CLICK_RENAME {singleClicked = false;renameTimer.stop();}
#define PROPS static_cast<KrBriefViewProperties*>(_properties) #define PROPS static_cast<KrBriefViewProperties*>(_properties)
#define MAX_COLS 5 #define MAX_COLS 5
#define VF getVfile() #define VF getVfile()
@ -69,9 +69,9 @@ void KrBriefViewToolTip::maybeTip( const TQPoint &pos )
if ( !item ) if ( !item )
return; return;
int width = TQFontMetrics( view->font() ).width( item->text() ) + 4; int width = TQFontMetrics( view->font() ).width( item->text() ) + 4;
TQRect r = item->rect(); TQRect r = item->rect();
r.setTopLeft( view->contentsToViewport( r.topLeft() ) ); r.setTopLeft( view->contentsToViewport( r.topLeft() ) );
if( width > item->textRect().width() ) if( width > item->textRect().width() )
@ -92,7 +92,7 @@ KrBriefView::KrBriefView( TQHeader * headerIn, TQWidget *parent, bool &left, TDE
void KrBriefView::setup() { void KrBriefView::setup() {
lastSwushPosition = 0; lastSwushPosition = 0;
// use the {} so that TDEConfigGroupSaver will work correctly! // use the {} so that TDEConfigGroupSaver will work correctly!
TDEConfigGroupSaver grpSvr( _config, "Look&Feel" ); TDEConfigGroupSaver grpSvr( _config, "Look&Feel" );
setFont( _config->readFontEntry( "Filelist Font", _FilelistFont ) ); setFont( _config->readFontEntry( "Filelist Font", _FilelistFont ) );
@ -119,7 +119,7 @@ void KrBriefView::setup() {
// add whatever columns are needed to the listview // add whatever columns are needed to the listview
krConfig->setGroup( nameInTDEConfig() ); krConfig->setGroup( nameInTDEConfig() );
// determine basic settings for the view // determine basic settings for the view
setAcceptDrops( true ); setAcceptDrops( true );
setItemsMovable( false ); setItemsMovable( false );
@ -131,7 +131,7 @@ void KrBriefView::setup() {
// allow in-place renaming // allow in-place renaming
connect( this, TQT_SIGNAL( itemRenamed ( TQIconViewItem * ) ), connect( this, TQT_SIGNAL( itemRenamed ( TQIconViewItem * ) ),
this, TQT_SLOT( inplaceRenameFinished( TQIconViewItem * ) ) ); this, TQT_SLOT( inplaceRenameFinished( TQIconViewItem * ) ) );
connect( &renameTimer, TQT_SIGNAL( timeout() ), this, TQT_SLOT( renameCurrentItem() ) ); connect( &renameTimer, TQT_SIGNAL( timeout() ), this, TQT_SLOT( renameCurrentItem() ) );
connect( &contextMenuTimer, TQT_SIGNAL (timeout()), this, TQT_SLOT (showContextMenu())); connect( &contextMenuTimer, TQT_SIGNAL (timeout()), this, TQT_SLOT (showContextMenu()));
@ -144,7 +144,7 @@ void KrBriefView::setup() {
CANCEL_TWO_CLICK_RENAME; CANCEL_TWO_CLICK_RENAME;
// setting the header // setting the header
while( header->count() ) while( header->count() )
header->removeLabel( 0 ); header->removeLabel( 0 );
@ -440,12 +440,12 @@ void KrBriefView::contentsMousePressEvent( TQMouseEvent * e ) {
pressedItem = 0; pressedItem = 0;
e = transformMouseEvent( e ); e = transformMouseEvent( e );
TQIconViewItem * oldCurrent = currentItem(); TQIconViewItem * oldCurrent = currentItem();
TQIconViewItem *newCurrent = findItem( e->pos() ); TQIconViewItem *newCurrent = findItem( e->pos() );
if (e->button() == Qt::RightButton) if (e->button() == Qt::RightButton)
{ {
if (KrSelectionMode::getSelectionHandler()->rightButtonSelects() || if (KrSelectionMode::getSelectionHandler()->rightButtonSelects() ||
(((e->state() & ShiftButton) || (e->state() & ControlButton))) && KrSelectionMode::getSelectionHandler()->shiftCtrlRightButtonSelects()) (((e->state() & ShiftButton) || (e->state() & ControlButton))) && KrSelectionMode::getSelectionHandler()->shiftCtrlRightButtonSelects())
{ {
if (KrSelectionMode::getSelectionHandler()->rightButtonPreservesSelection() && !(e->state() & ShiftButton) if (KrSelectionMode::getSelectionHandler()->rightButtonPreservesSelection() && !(e->state() & ShiftButton)
@ -504,7 +504,7 @@ void KrBriefView::contentsMousePressEvent( TQMouseEvent * e ) {
if (e->button() == Qt::LeftButton) if (e->button() == Qt::LeftButton)
{ {
dragStartPos = e->pos(); dragStartPos = e->pos();
if (KrSelectionMode::getSelectionHandler()->leftButtonSelects() || if (KrSelectionMode::getSelectionHandler()->leftButtonSelects() ||
(((e->state() & ShiftButton) || (e->state() & ControlButton))) && (((e->state() & ShiftButton) || (e->state() & ControlButton))) &&
KrSelectionMode::getSelectionHandler()->shiftCtrlLeftButtonSelects()) KrSelectionMode::getSelectionHandler()->shiftCtrlLeftButtonSelects())
{ {
@ -582,10 +582,10 @@ void KrBriefView::contentsMousePressEvent( TQMouseEvent * e ) {
if( e->state() & ShiftButton ) if( e->state() & ShiftButton )
callDefaultHandler = false; callDefaultHandler = false;
} }
if (selectionChanged) if (selectionChanged)
updateView(); // don't call triggerUpdate directly! updateView(); // don't call triggerUpdate directly!
if (callDefaultHandler) if (callDefaultHandler)
{ {
dragStartPos = TQPoint( -1, -1 ); dragStartPos = TQPoint( -1, -1 );
@ -631,11 +631,11 @@ void KrBriefView::contentsMousePressEvent( TQMouseEvent * e ) {
void KrBriefView::contentsMouseReleaseEvent( TQMouseEvent * e ) { void KrBriefView::contentsMouseReleaseEvent( TQMouseEvent * e ) {
if (e->button() == Qt::RightButton) if (e->button() == Qt::RightButton)
contextMenuTimer.stop(); contextMenuTimer.stop();
e = transformMouseEvent( e ); e = transformMouseEvent( e );
TDEIconView::contentsMouseReleaseEvent( e ); TDEIconView::contentsMouseReleaseEvent( e );
if( pressedItem ) { if( pressedItem ) {
TQPoint vp = contentsToViewport( e->pos() ); TQPoint vp = contentsToViewport( e->pos() );
TQIconViewItem *newCurrent = findItem( e->pos() ); TQIconViewItem *newCurrent = findItem( e->pos() );
@ -665,8 +665,8 @@ void KrBriefView::contentsMouseMoveEvent ( TQMouseEvent * e ) {
if ( dragStartPos != TQPoint( -1, -1 ) && if ( dragStartPos != TQPoint( -1, -1 ) &&
e->state() & Qt::LeftButton && ( dragStartPos - e->pos() ).manhattanLength() > TQApplication::startDragDistance() ) e->state() & Qt::LeftButton && ( dragStartPos - e->pos() ).manhattanLength() > TQApplication::startDragDistance() )
startDrag(); startDrag();
if (KrSelectionMode::getSelectionHandler()->rightButtonPreservesSelection() if (KrSelectionMode::getSelectionHandler()->rightButtonPreservesSelection()
&& KrSelectionMode::getSelectionHandler()->rightButtonSelects() && KrSelectionMode::getSelectionHandler()->rightButtonSelects()
&& KrSelectionMode::getSelectionHandler()->showContextMenu() >= 0 && e->state() == Qt::RightButton) && KrSelectionMode::getSelectionHandler()->showContextMenu() >= 0 && e->state() == Qt::RightButton)
{ {
TQIconViewItem *newItem = findItem( e->pos() ); TQIconViewItem *newItem = findItem( e->pos() );
@ -754,7 +754,7 @@ void KrBriefView::contentsDropEvent( TQDropEvent * e ) {
_currDragItem = 0; _currDragItem = 0;
op()->emitGotDrop(e); op()->emitGotDrop(e);
e->ignore(); e->ignore();
TDEIconView::contentsDropEvent( e ); TDEIconView::contentsDropEvent( e );
} }
void KrBriefView::contentsDragMoveEvent( TQDragMoveEvent * e ) { void KrBriefView::contentsDragMoveEvent( TQDragMoveEvent * e ) {
@ -763,7 +763,7 @@ void KrBriefView::contentsDragMoveEvent( TQDragMoveEvent * e ) {
_currDragItem = getKrViewItemAt( e->pos() ); _currDragItem = getKrViewItemAt( e->pos() );
if( _currDragItem && !_currDragItem->VF->vfile_isDir() ) if( _currDragItem && !_currDragItem->VF->vfile_isDir() )
_currDragItem = 0; _currDragItem = 0;
TDEIconView::contentsDragMoveEvent( e ); TDEIconView::contentsDragMoveEvent( e );
if( _currDragItem != oldDragItem ) if( _currDragItem != oldDragItem )
@ -1031,7 +1031,7 @@ void KrBriefView::keyPressEvent( TQKeyEvent * e ) {
case Key_Delete : // kill file case Key_Delete : // kill file
SLOTS->deleteFiles( e->state() == ShiftButton || e->state() == ControlButton ); SLOTS->deleteFiles( e->state() == ShiftButton || e->state() == ControlButton );
break ; break ;
case Key_Insert : { case Key_Insert : {
{ {
@ -1093,7 +1093,7 @@ void KrBriefView::keyPressEvent( TQKeyEvent * e ) {
( e->key() >= Key_0 && e->key() <= Key_9 ) || ( e->key() >= Key_0 && e->key() <= Key_9 ) ||
( e->key() == Key_Backspace ) || ( e->key() == Key_Backspace ) ||
( e->key() == Key_Down ) || ( e->key() == Key_Down ) ||
( e->key() == Key_Period ) ) */{ ( e->key() == Key_Period ) ) */{
// are we doing quicksearch? if not, send keys to panel // are we doing quicksearch? if not, send keys to panel
//if ( _config->readBoolEntry( "Do Quicksearch", _DoQuicksearch ) ) { //if ( _config->readBoolEntry( "Do Quicksearch", _DoQuicksearch ) ) {
// are we using krusader's classic quicksearch, or wincmd style? // are we using krusader's classic quicksearch, or wincmd style?
@ -1142,7 +1142,7 @@ void KrBriefView::renameCurrentItem() {
TQString newName, fileName; TQString newName, fileName;
// handle inplace renaming, if possible // handle inplace renaming, if possible
KrBriefViewItem *it = static_cast<KrBriefViewItem*>(getCurrentKrViewItem()); KrBriefViewItem *it = static_cast<KrBriefViewItem*>(getCurrentKrViewItem());
if ( it ) if ( it )
fileName = it->name(); fileName = it->name();
@ -1157,7 +1157,7 @@ void KrBriefView::renameCurrentItem() {
/* TODO: /* TODO:
TDEConfigGroupSaver svr(krConfig,"Look&Feel"); TDEConfigGroupSaver svr(krConfig,"Look&Feel");
if (!krConfig->readBoolEntry("Rename Selects Extension", true)) { if (!krConfig->readBoolEntry("Rename Selects Extension", true)) {
if (it->hasExtension() && !it->VF->vfile_isDir() ) if (it->hasExtension() && !it->VF->vfile_isDir() )
renameLineEdit()->setSelection(0, it->name().findRev(it->extension())-1); renameLineEdit()->setSelection(0, it->name().findRev(it->extension())-1);
}*/ }*/
} }
@ -1226,7 +1226,7 @@ void KrBriefView::slotMouseClicked( int button, TQIconViewItem * item, const TQP
void KrBriefView::refreshColors() { void KrBriefView::refreshColors() {
krConfig->setGroup("Colors"); krConfig->setGroup("Colors");
bool kdeDefault = krConfig->readBoolEntry("KDE Default"); bool kdeDefault = krConfig->readBoolEntry("KDE Default");
if ( !kdeDefault ) { if ( !kdeDefault ) {
// KDE default is not choosen: set the background color (as this paints the empty areas) and the alternate color // KDE default is not choosen: set the background color (as this paints the empty areas) and the alternate color
bool isActive = hasFocus(); bool isActive = hasFocus();
@ -1289,7 +1289,7 @@ bool KrBriefView::eventFilter( TQObject * watched, TQEvent * e )
void KrBriefView::makeItemVisible( const KrViewItem *item ) { void KrBriefView::makeItemVisible( const KrViewItem *item ) {
// tqApp->processEvents(); // Please don't remove the comment. Causes crash if it is inserted! // tqApp->processEvents(); // Please don't remove the comment. Causes crash if it is inserted!
ensureItemVisible( (TQIconViewItem *)( static_cast<const KrBriefViewItem*>( item ) ) ); ensureItemVisible( (TQIconViewItem *)( static_cast<const KrBriefViewItem*>( item ) ) );
} }
void KrBriefView::initOperator() { void KrBriefView::initOperator() {
@ -1307,18 +1307,19 @@ void KrBriefView::initProperties() {
_properties->displayIcons = _config->readBoolEntry( "With Icons", _WithIcons ); _properties->displayIcons = _config->readBoolEntry( "With Icons", _WithIcons );
bool dirsByNameAlways = _config->readBoolEntry("Always sort dirs by name", false); bool dirsByNameAlways = _config->readBoolEntry("Always sort dirs by name", false);
_properties->sortMode = static_cast<KrViewProperties::SortSpec>( KrViewProperties::Name | _properties->sortMode = static_cast<KrViewProperties::SortSpec>( KrViewProperties::Name |
KrViewProperties::Descending | KrViewProperties::DirsFirst | KrViewProperties::Descending | KrViewProperties::DirsFirst |
(dirsByNameAlways ? KrViewProperties::AlwaysSortDirsByName : 0) ); (dirsByNameAlways ? KrViewProperties::AlwaysSortDirsByName : 0) );
if ( !_config->readBoolEntry( "Case Sensative Sort", _CaseSensativeSort ) ) if ( !_config->readBoolEntry( "Case Sensative Sort", _CaseSensativeSort ) )
_properties->sortMode = static_cast<KrViewProperties::SortSpec>( _properties->sortMode | _properties->sortMode = static_cast<KrViewProperties::SortSpec>( _properties->sortMode |
KrViewProperties::IgnoreCase ); KrViewProperties::IgnoreCase );
_properties->humanReadableSize = krConfig->readBoolEntry("Human Readable Size", _HumanReadableSize); _properties->humanReadableSize = krConfig->readBoolEntry("Human Readable Size", _HumanReadableSize);
_properties->localeAwareCompareIsCaseSensitive = TQString( "a" ).localeAwareCompare( "B" ) > 0; // see KDE bug #40131 _properties->localeAwareCompareIsCaseSensitive = TQString( "a" ).localeAwareCompare( "B" ) > 0; // see KDE bug #40131
TQStringList defaultAtomicExtensions; TQStringList defaultAtomicExtensions;
defaultAtomicExtensions += ".tar.gz"; defaultAtomicExtensions += ".tar.gz";
defaultAtomicExtensions += ".tar.bz2"; defaultAtomicExtensions += ".tar.bz2";
defaultAtomicExtensions += ".moc.cpp"; defaultAtomicExtensions += ".moc.cpp";
defaultAtomicExtensions += ".tar.xz";
TQStringList atomicExtensions = krConfig->readListEntry("Atomic Extensions", defaultAtomicExtensions); TQStringList atomicExtensions = krConfig->readListEntry("Atomic Extensions", defaultAtomicExtensions);
for (TQStringList::iterator i = atomicExtensions.begin(); i != atomicExtensions.end(); ) for (TQStringList::iterator i = atomicExtensions.begin(); i != atomicExtensions.end(); )
{ {
@ -1334,7 +1335,7 @@ void KrBriefView::initProperties() {
++i; ++i;
} }
_properties->atomicExtensions = atomicExtensions; _properties->atomicExtensions = atomicExtensions;
_config->setGroup( nameInTDEConfig() ); _config->setGroup( nameInTDEConfig() );
PROPS->numberOfColumns = _config->readNumEntry( "Number Of Brief Columns", _NumberOfBriefColumns ); PROPS->numberOfColumns = _config->readNumEntry( "Number Of Brief Columns", _NumberOfBriefColumns );
if( PROPS->numberOfColumns < 1 ) if( PROPS->numberOfColumns < 1 )
@ -1347,7 +1348,7 @@ void KrBriefView::setColumnNr()
{ {
TDEPopupMenu popup( this ); TDEPopupMenu popup( this );
popup.insertTitle( i18n("Columns")); popup.insertTitle( i18n("Columns"));
int COL_ID = 14700; int COL_ID = 14700;
for( int i=1; i <= MAX_COLS; i++ ) for( int i=1; i <= MAX_COLS; i++ )
@ -1355,11 +1356,11 @@ void KrBriefView::setColumnNr()
popup.insertItem( TQString( "%1" ).arg( i ), COL_ID + i ); popup.insertItem( TQString( "%1" ).arg( i ), COL_ID + i );
popup.setItemChecked( COL_ID + i, PROPS->numberOfColumns == i ); popup.setItemChecked( COL_ID + i, PROPS->numberOfColumns == i );
} }
int result=popup.exec(TQCursor::pos()); int result=popup.exec(TQCursor::pos());
krConfig->setGroup( nameInTDEConfig() ); krConfig->setGroup( nameInTDEConfig() );
if( result > COL_ID && result <= COL_ID + MAX_COLS ) if( result > COL_ID && result <= COL_ID + MAX_COLS )
{ {
krConfig->writeEntry( "Number Of Brief Columns", result - COL_ID ); krConfig->writeEntry( "Number Of Brief Columns", result - COL_ID );
@ -1370,7 +1371,7 @@ void KrBriefView::setColumnNr()
void KrBriefView::sortOrderChanged() { void KrBriefView::sortOrderChanged() {
ensureItemVisible(currentItem()); ensureItemVisible(currentItem());
if( !_focused ) if( !_focused )
op()->emitNeedFocus(); op()->emitNeedFocus();
@ -1400,14 +1401,14 @@ TQMouseEvent * KrBriefView::transformMouseEvent( TQMouseEvent * e )
{ {
if( findItem( e->pos() ) != 0 ) if( findItem( e->pos() ) != 0 )
return e; return e;
TQIconViewItem *closestItem = 0; TQIconViewItem *closestItem = 0;
int mouseX = e->pos().x(), mouseY = e->pos().y(); int mouseX = e->pos().x(), mouseY = e->pos().y();
int closestDelta = 0x7FFFFFFF; int closestDelta = 0x7FFFFFFF;
int minX = ( mouseX / gridX() ) * gridX(); int minX = ( mouseX / gridX() ) * gridX();
int maxX = minX + gridX(); int maxX = minX + gridX();
TQIconViewItem *current = firstItem(); TQIconViewItem *current = firstItem();
while( current ) while( current )
{ {
@ -1422,7 +1423,7 @@ TQMouseEvent * KrBriefView::transformMouseEvent( TQMouseEvent * e )
} }
current = current->nextItem(); current = current->nextItem();
} }
if( closestItem != 0 ) if( closestItem != 0 )
{ {
if( mouseX - closestItem->x() > gridX() ) if( mouseX - closestItem->x() > gridX() )
@ -1430,7 +1431,7 @@ TQMouseEvent * KrBriefView::transformMouseEvent( TQMouseEvent * e )
else if( mouseY - closestItem->y() > closestItem->height() ) else if( mouseY - closestItem->y() > closestItem->height() )
closestItem = 0; closestItem = 0;
} }
if( closestItem != 0 ) if( closestItem != 0 )
{ {
TQRect rec = closestItem->textRect( false ); TQRect rec = closestItem->textRect( false );
@ -1449,12 +1450,12 @@ TQMouseEvent * KrBriefView::transformMouseEvent( TQMouseEvent * e )
glPos = TQPoint( mouseX - e->pos().x() + e->globalPos().x(), glPos = TQPoint( mouseX - e->pos().x() + e->globalPos().x(),
mouseY - e->pos().y() + e->globalPos().y() ); mouseY - e->pos().y() + e->globalPos().y() );
} }
if( mouseEvent ) if( mouseEvent )
delete mouseEvent; delete mouseEvent;
return mouseEvent = new TQMouseEvent( e->type(), newPos, glPos, e->button(), e->state() ); return mouseEvent = new TQMouseEvent( e->type(), newPos, glPos, e->button(), e->state() );
} }
return e; return e;
} }

@ -59,28 +59,28 @@ YP YD 88 YD ~Y8888P' `8888Y' YP YP Y8888D' Y88888P 88 YD
// Group name: KrDetailedView // Group name: KrDetailedView
// //
// Ext Column // Ext Column
#define _ExtColumn true #define _ExtColumn true
// Mime Column // Mime Column
#define _MimeColumn false #define _MimeColumn false
// Size Column // Size Column
#define _SizeColumn true #define _SizeColumn true
// DateTime Column // DateTime Column
#define _DateTimeColumn true #define _DateTimeColumn true
// Perm Column // Perm Column
#define _PermColumn false #define _PermColumn false
// KrPerm Column // KrPerm Column
#define _KrPermColumn true #define _KrPermColumn true
// Owner Column // Owner Column
#define _OwnerColumn false #define _OwnerColumn false
// Group Column // Group Column
#define _GroupColumn false #define _GroupColumn false
// Do Quicksearch // Do Quicksearch
#define _DoQuicksearch true #define _DoQuicksearch true
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
#define CANCEL_TWO_CLICK_RENAME {singleClicked = false;renameTimer.stop();} #define CANCEL_TWO_CLICK_RENAME {singleClicked = false;renameTimer.stop();}
#define COLUMN(X) static_cast<KrDetailedViewProperties*>(_properties)->column[ KrDetailedViewProperties::X ] #define COLUMN(X) static_cast<KrDetailedViewProperties*>(_properties)->column[ KrDetailedViewProperties::X ]
#define PROPS static_cast<KrDetailedViewProperties*>(_properties) #define PROPS static_cast<KrDetailedViewProperties*>(_properties)
#define VF getVfile() #define VF getVfile()
#define COLUMN_POPUP_IDS 91 #define COLUMN_POPUP_IDS 91
@ -140,7 +140,7 @@ void KrDetailedView::setup() {
// add whatever columns are needed to the listview // add whatever columns are needed to the listview
krConfig->setGroup( nameInTDEConfig() ); krConfig->setGroup( nameInTDEConfig() );
newColumn( KrDetailedViewProperties::Name ); // we always have a name newColumn( KrDetailedViewProperties::Name ); // we always have a name
setColumnWidthMode( COLUMN(Name), TQListView::Manual ); setColumnWidthMode( COLUMN(Name), TQListView::Manual );
if ( _config->readBoolEntry( "Ext Column", _ExtColumn ) ) { if ( _config->readBoolEntry( "Ext Column", _ExtColumn ) ) {
@ -186,7 +186,7 @@ void KrDetailedView::setup() {
setColumnWidthMode( COLUMN(Group), TQListView::Manual ); setColumnWidthMode( COLUMN(Group), TQListView::Manual );
setColumnWidth( COLUMN(Group), TQFontMetrics( font() ).width( 'X' ) * 6 ); setColumnWidth( COLUMN(Group), TQFontMetrics( font() ).width( 'X' ) * 6 );
} }
// determine basic settings for the listview // determine basic settings for the listview
setAcceptDrops( true ); setAcceptDrops( true );
setDragEnabled( true ); setDragEnabled( true );
@ -205,7 +205,7 @@ void KrDetailedView::setup() {
header()->installEventFilter( this ); header()->installEventFilter( this );
renameLineEdit()->installEventFilter( this ); renameLineEdit()->installEventFilter( this );
// allow in-place renaming // allow in-place renaming
connect( renameLineEdit(), TQT_SIGNAL( done( TQListViewItem *, int ) ), connect( renameLineEdit(), TQT_SIGNAL( done( TQListViewItem *, int ) ),
this, TQT_SLOT( inplaceRenameFinished( TQListViewItem*, int ) ) ); this, TQT_SLOT( inplaceRenameFinished( TQListViewItem*, int ) ) );
@ -235,7 +235,7 @@ void KrDetailedView::newColumn( KrDetailedViewProperties::ColumnType type ) {
} }
if ( max >= KrDetailedViewProperties::MAX_COLUMNS ) if ( max >= KrDetailedViewProperties::MAX_COLUMNS )
perror( "KrDetailedView::newColumn() - too many columns" ); perror( "KrDetailedView::newColumn() - too many columns" );
PROPS->column[type] = max; PROPS->column[type] = max;
addColumn( ColumnName[type], -1 ); addColumn( ColumnName[type], -1 );
} }
@ -535,7 +535,7 @@ void KrDetailedView::contentsMousePressEvent( TQMouseEvent * e ) {
TQListViewItem *newCurrent = itemAt( contentsToViewport( e->pos() ) ); TQListViewItem *newCurrent = itemAt( contentsToViewport( e->pos() ) );
if (e->button() == Qt::RightButton) if (e->button() == Qt::RightButton)
{ {
if (KrSelectionMode::getSelectionHandler()->rightButtonSelects() || if (KrSelectionMode::getSelectionHandler()->rightButtonSelects() ||
(((e->state() & ShiftButton) || (e->state() & ControlButton))) && KrSelectionMode::getSelectionHandler()->shiftCtrlRightButtonSelects()) (((e->state() & ShiftButton) || (e->state() & ControlButton))) && KrSelectionMode::getSelectionHandler()->shiftCtrlRightButtonSelects())
{ {
if (KrSelectionMode::getSelectionHandler()->rightButtonPreservesSelection() && !(e->state() & ShiftButton) if (KrSelectionMode::getSelectionHandler()->rightButtonPreservesSelection() && !(e->state() & ShiftButton)
@ -594,7 +594,7 @@ void KrDetailedView::contentsMousePressEvent( TQMouseEvent * e ) {
if (e->button() == Qt::LeftButton) if (e->button() == Qt::LeftButton)
{ {
dragStartPos = e->pos(); dragStartPos = e->pos();
if (KrSelectionMode::getSelectionHandler()->leftButtonSelects() || if (KrSelectionMode::getSelectionHandler()->leftButtonSelects() ||
(((e->state() & ShiftButton) || (e->state() & ControlButton))) && (((e->state() & ShiftButton) || (e->state() & ControlButton))) &&
KrSelectionMode::getSelectionHandler()->shiftCtrlLeftButtonSelects()) KrSelectionMode::getSelectionHandler()->shiftCtrlLeftButtonSelects())
{ {
@ -667,10 +667,10 @@ void KrDetailedView::contentsMousePressEvent( TQMouseEvent * e ) {
callDefaultHandler = false; callDefaultHandler = false;
} }
} }
if (selectionChanged) if (selectionChanged)
updateView(); // don't call triggerUpdate directly! updateView(); // don't call triggerUpdate directly!
// TQListViewItem * i = itemAt( contentsToViewport( e->pos() ) ); // TQListViewItem * i = itemAt( contentsToViewport( e->pos() ) );
if (callDefaultHandler) if (callDefaultHandler)
{ {
@ -745,8 +745,8 @@ void KrDetailedView::contentsMouseMoveEvent ( TQMouseEvent * e ) {
if ( dragStartPos != TQPoint( -1, -1 ) && if ( dragStartPos != TQPoint( -1, -1 ) &&
e->state() & Qt::LeftButton && ( dragStartPos - e->pos() ).manhattanLength() > TQApplication::startDragDistance() ) e->state() & Qt::LeftButton && ( dragStartPos - e->pos() ).manhattanLength() > TQApplication::startDragDistance() )
startDrag(); startDrag();
if (KrSelectionMode::getSelectionHandler()->rightButtonPreservesSelection() if (KrSelectionMode::getSelectionHandler()->rightButtonPreservesSelection()
&& KrSelectionMode::getSelectionHandler()->rightButtonSelects() && KrSelectionMode::getSelectionHandler()->rightButtonSelects()
&& KrSelectionMode::getSelectionHandler()->showContextMenu() >= 0 && e->state() == Qt::RightButton) && KrSelectionMode::getSelectionHandler()->showContextMenu() >= 0 && e->state() == Qt::RightButton)
{ {
TQListViewItem *newItem = itemAt( contentsToViewport( e->pos() ) ); TQListViewItem *newItem = itemAt( contentsToViewport( e->pos() ) );
@ -852,7 +852,7 @@ void KrDetailedView::contentsDragMoveEvent( TQDragMoveEvent * e ) {
_currDragItem = getKrViewItemAt(contentsToViewport(e->pos())); _currDragItem = getKrViewItemAt(contentsToViewport(e->pos()));
if( _currDragItem && !_currDragItem->VF->vfile_isDir() ) if( _currDragItem && !_currDragItem->VF->vfile_isDir() )
_currDragItem = 0; _currDragItem = 0;
TDEListView::contentsDragMoveEvent( e ); TDEListView::contentsDragMoveEvent( e );
} }
@ -1022,7 +1022,7 @@ void KrDetailedView::keyPressEvent( TQKeyEvent * e ) {
TQString tmp = i->name(); TQString tmp = i->name();
op()->emitExecuted(tmp); // thereby emulating a chdir op()->emitExecuted(tmp); // thereby emulating a chdir
} else if( i->VF->vfile_getUrl().isLocalFile() ) { } else if( i->VF->vfile_getUrl().isLocalFile() ) {
bool encrypted; bool encrypted;
KURL url = i->VF->vfile_getUrl(); KURL url = i->VF->vfile_getUrl();
TQString mime = ((vfile *)(i->VF))->vfile_getMime(); TQString mime = ((vfile *)(i->VF))->vfile_getMime();
TQString type = KRarcHandler::getType( encrypted, url.path(), mime, false ); TQString type = KRarcHandler::getType( encrypted, url.path(), mime, false );
@ -1061,7 +1061,7 @@ void KrDetailedView::keyPressEvent( TQKeyEvent * e ) {
#endif*/ #endif*/
case Key_Delete : // kill file case Key_Delete : // kill file
SLOTS->deleteFiles( e->state() == ShiftButton || e->state() == ControlButton ); SLOTS->deleteFiles( e->state() == ShiftButton || e->state() == ControlButton );
break ; break ;
case Key_Insert : { case Key_Insert : {
if (KrSelectionMode::getSelectionHandler()->insertMovesDown()) if (KrSelectionMode::getSelectionHandler()->insertMovesDown())
@ -1071,7 +1071,7 @@ void KrDetailedView::keyPressEvent( TQKeyEvent * e ) {
TQKeyEvent ev = TQKeyEvent( TQKeyEvent::KeyPress, Key_Space, 0, 0 ); TQKeyEvent ev = TQKeyEvent( TQKeyEvent::KeyPress, Key_Space, 0, 0 );
TDEListView::keyPressEvent( & ev ); TDEListView::keyPressEvent( & ev );
} }
break ; break ;
} }
case Key_Space : { case Key_Space : {
KrDetailedViewItem * viewItem = static_cast<KrDetailedViewItem *> ( getCurrentKrViewItem() ); KrDetailedViewItem * viewItem = static_cast<KrDetailedViewItem *> ( getCurrentKrViewItem() );
@ -1083,9 +1083,9 @@ void KrDetailedView::keyPressEvent( TQKeyEvent * e ) {
} }
else else
TDEListView::keyPressEvent( e ); TDEListView::keyPressEvent( e );
break ; break ;
} }
if ( viewItem->VF->vfile_isDir() && viewItem->VF->vfile_getSize() <= 0 && if ( viewItem->VF->vfile_isDir() && viewItem->VF->vfile_getSize() <= 0 &&
KrSelectionMode::getSelectionHandler()->spaceCalculatesDiskSpace()) { KrSelectionMode::getSelectionHandler()->spaceCalculatesDiskSpace()) {
// //
// NOTE: this is buggy incase somewhere down in the folder we're calculating, // NOTE: this is buggy incase somewhere down in the folder we're calculating,
@ -1130,7 +1130,7 @@ mark: if (KrSelectionMode::getSelectionHandler()->spaceMovesDown())
( e->key() >= Key_0 && e->key() <= Key_9 ) || ( e->key() >= Key_0 && e->key() <= Key_9 ) ||
( e->key() == Key_Backspace ) || ( e->key() == Key_Backspace ) ||
( e->key() == Key_Down ) || ( e->key() == Key_Down ) ||
( e->key() == Key_Period ) ) */{ ( e->key() == Key_Period ) ) */{
// are we doing quicksearch? if not, send keys to panel // are we doing quicksearch? if not, send keys to panel
//if ( _config->readBoolEntry( "Do Quicksearch", _DoQuicksearch ) ) { //if ( _config->readBoolEntry( "Do Quicksearch", _DoQuicksearch ) ) {
// are we using krusader's classic quicksearch, or wincmd style? // are we using krusader's classic quicksearch, or wincmd style?
@ -1192,7 +1192,7 @@ void KrDetailedView::renameCurrentItem() {
TQString newName, fileName; TQString newName, fileName;
// handle inplace renaming, if possible // handle inplace renaming, if possible
KrDetailedViewItem *it = static_cast<KrDetailedViewItem*>(getCurrentKrViewItem()); KrDetailedViewItem *it = static_cast<KrDetailedViewItem*>(getCurrentKrViewItem());
if ( it ) if ( it )
fileName = it->name(); fileName = it->name();
@ -1214,7 +1214,7 @@ void KrDetailedView::renameCurrentItem() {
// if applicable, select only the name without extension // if applicable, select only the name without extension
TDEConfigGroupSaver svr(krConfig,"Look&Feel"); TDEConfigGroupSaver svr(krConfig,"Look&Feel");
if (!krConfig->readBoolEntry("Rename Selects Extension", true)) { if (!krConfig->readBoolEntry("Rename Selects Extension", true)) {
if (it->hasExtension() && !it->VF->vfile_isDir() ) if (it->hasExtension() && !it->VF->vfile_isDir() )
renameLineEdit()->setSelection(0, it->name().findRev(it->extension())-1); renameLineEdit()->setSelection(0, it->name().findRev(it->extension())-1);
} }
// signal will be emited when renaming is done, and finalization // signal will be emited when renaming is done, and finalization
@ -1234,10 +1234,10 @@ void KrDetailedView::inplaceRenameFinished( TQListViewItem * it, int ) {
krOut << "Major failure at inplaceRenameFinished(): item is null" << endl; krOut << "Major failure at inplaceRenameFinished(): item is null" << endl;
return; return;
} }
if( COLUMN( Extention ) != -1 && !currentlyRenamedItem ) if( COLUMN( Extention ) != -1 && !currentlyRenamedItem )
return; /* does the event filter restored the original state? */ return; /* does the event filter restored the original state? */
// check if the item was indeed renamed // check if the item was indeed renamed
bool restoreView = false; bool restoreView = false;
if ( it->text( COLUMN( Name ) ) != static_cast<KrDetailedViewItem*>( it ) ->name() ) { // was renamed if ( it->text( COLUMN( Name ) ) != static_cast<KrDetailedViewItem*>( it ) ->name() ) { // was renamed
@ -1249,7 +1249,7 @@ void KrDetailedView::inplaceRenameFinished( TQListViewItem * it, int ) {
#if 0 #if 0
if ( COLUMN( Extention ) != -1 && restoreView ) { // nothing happened, restore the view (if needed) if ( COLUMN( Extention ) != -1 && restoreView ) { // nothing happened, restore the view (if needed)
#endif #endif
TQString ext, name = static_cast<KrDetailedViewItem*>( it ) ->name(); TQString ext, name = static_cast<KrDetailedViewItem*>( it ) ->name();
if ( !static_cast<KrDetailedViewItem*>( it ) ->VF->vfile_isDir() && COLUMN( Extention ) != -1 ) { if ( !static_cast<KrDetailedViewItem*>( it ) ->VF->vfile_isDir() && COLUMN( Extention ) != -1 ) {
ext = static_cast<KrDetailedViewItem*>( it ) ->extension(); ext = static_cast<KrDetailedViewItem*>( it ) ->extension();
@ -1263,7 +1263,7 @@ void KrDetailedView::inplaceRenameFinished( TQListViewItem * it, int ) {
#endif #endif
setFocus(); setFocus();
currentlyRenamedItem = 0; currentlyRenamedItem = 0;
} }
@ -1318,8 +1318,8 @@ void KrDetailedView::slotMouseClicked( int button, TQListViewItem * item, const
void KrDetailedView::refreshColors() { void KrDetailedView::refreshColors() {
krConfig->setGroup("Colors"); krConfig->setGroup("Colors");
bool kdeDefault = krConfig->readBoolEntry("KDE Default"); bool kdeDefault = krConfig->readBoolEntry("KDE Default");
bool alternateBackgroundEnabled = krConfig->readBoolEntry("Enable Alternate Background"); bool alternateBackgroundEnabled = krConfig->readBoolEntry("Enable Alternate Background");
if ( !kdeDefault ) { if ( !kdeDefault ) {
// KDE default is not choosen: set the background color (as this paints the empty areas) and the alternate color // KDE default is not choosen: set the background color (as this paints the empty areas) and the alternate color
bool isActive = hasFocus(); bool isActive = hasFocus();
@ -1364,7 +1364,7 @@ bool KrDetailedView::eventFilter( TQObject * watched, TQEvent * e )
for( TQListViewItem *it = firstChild(); it; it = it->nextSibling() ) for( TQListViewItem *it = firstChild(); it; it = it->nextSibling() )
if( it == currentlyRenamedItem ) if( it == currentlyRenamedItem )
{ {
if ( it->text( COLUMN( Name ) ) == dynamic_cast<KrDetailedViewItem*>( it ) ->name() && COLUMN( Extention ) != -1 ) if ( it->text( COLUMN( Name ) ) == dynamic_cast<KrDetailedViewItem*>( it ) ->name() && COLUMN( Extention ) != -1 )
inplaceRenameFinished( it, COLUMN( Name ) ); inplaceRenameFinished( it, COLUMN( Name ) );
break; break;
} }
@ -1385,7 +1385,7 @@ bool KrDetailedView::eventFilter( TQObject * watched, TQEvent * e )
void KrDetailedView::makeItemVisible( const KrViewItem *item ) { void KrDetailedView::makeItemVisible( const KrViewItem *item ) {
// tqApp->processEvents(); // Please don't remove the comment. Causes crash if it is inserted! // tqApp->processEvents(); // Please don't remove the comment. Causes crash if it is inserted!
ensureItemVisible( static_cast<const KrDetailedViewItem*>( item ) ); ensureItemVisible( static_cast<const KrDetailedViewItem*>( item ) );
} }
void KrDetailedView::initOperator() { void KrDetailedView::initOperator() {
@ -1396,13 +1396,13 @@ void KrDetailedView::initOperator() {
void KrDetailedView::initProperties() { void KrDetailedView::initProperties() {
_properties = new KrDetailedViewProperties; _properties = new KrDetailedViewProperties;
TDEConfigGroupSaver grpSvr( _config, "Look&Feel" ); TDEConfigGroupSaver grpSvr( _config, "Look&Feel" );
for (int i=0; i<KrDetailedViewProperties::MAX_COLUMNS;++i) for (int i=0; i<KrDetailedViewProperties::MAX_COLUMNS;++i)
PROPS->column[i]=-1; PROPS->column[i]=-1;
PROPS->displayIcons = _config->readBoolEntry( "With Icons", _WithIcons ); PROPS->displayIcons = _config->readBoolEntry( "With Icons", _WithIcons );
bool dirsByNameAlways = _config->readBoolEntry("Always sort dirs by name", false); bool dirsByNameAlways = _config->readBoolEntry("Always sort dirs by name", false);
PROPS->sortMode = static_cast<KrViewProperties::SortSpec>( KrViewProperties::Name | PROPS->sortMode = static_cast<KrViewProperties::SortSpec>( KrViewProperties::Name |
KrViewProperties::Descending | KrViewProperties::DirsFirst | KrViewProperties::Descending | KrViewProperties::DirsFirst |
(dirsByNameAlways ? KrViewProperties::AlwaysSortDirsByName : 0) ); (dirsByNameAlways ? KrViewProperties::AlwaysSortDirsByName : 0) );
PROPS->numericPermissions = _config->readBoolEntry("Numeric permissions", _NumericPermissions); PROPS->numericPermissions = _config->readBoolEntry("Numeric permissions", _NumericPermissions);
if ( !_config->readBoolEntry( "Case Sensative Sort", _CaseSensativeSort ) ) if ( !_config->readBoolEntry( "Case Sensative Sort", _CaseSensativeSort ) )
@ -1414,6 +1414,7 @@ void KrDetailedView::initProperties() {
defaultAtomicExtensions += ".tar.gz"; defaultAtomicExtensions += ".tar.gz";
defaultAtomicExtensions += ".tar.bz2"; defaultAtomicExtensions += ".tar.bz2";
defaultAtomicExtensions += ".moc.cpp"; defaultAtomicExtensions += ".moc.cpp";
defaultAtomicExtensions += ".tar.xz";
TQStringList atomicExtensions = krConfig->readListEntry("Atomic Extensions", defaultAtomicExtensions); TQStringList atomicExtensions = krConfig->readListEntry("Atomic Extensions", defaultAtomicExtensions);
for (TQStringList::iterator i = atomicExtensions.begin(); i != atomicExtensions.end(); ) for (TQStringList::iterator i = atomicExtensions.begin(); i != atomicExtensions.end(); )
{ {
@ -1435,9 +1436,9 @@ void KrDetailedView::selectColumns()
{ {
TDEPopupMenu popup( this ); TDEPopupMenu popup( this );
popup.insertTitle( i18n("Columns")); popup.insertTitle( i18n("Columns"));
bool refresh = false; bool refresh = false;
bool hasExtention = COLUMN( Extention ) != -1; bool hasExtention = COLUMN( Extention ) != -1;
bool hasMime = COLUMN( Mime ) != -1; bool hasMime = COLUMN( Mime ) != -1;
bool hasSize = COLUMN( Size ) != -1; bool hasSize = COLUMN( Size ) != -1;
@ -1446,7 +1447,7 @@ void KrDetailedView::selectColumns()
bool hasKrPerms = COLUMN( KrPermissions ) != -1; bool hasKrPerms = COLUMN( KrPermissions ) != -1;
bool hasOwner = COLUMN( Owner ) != -1; bool hasOwner = COLUMN( Owner ) != -1;
bool hasGroup = COLUMN( Group ) != -1; bool hasGroup = COLUMN( Group ) != -1;
popup.insertItem( i18n( "Ext" ), COLUMN_POPUP_IDS + KrDetailedViewProperties::Extention ); popup.insertItem( i18n( "Ext" ), COLUMN_POPUP_IDS + KrDetailedViewProperties::Extention );
popup.setItemChecked( COLUMN_POPUP_IDS + KrDetailedViewProperties::Extention, hasExtention ); popup.setItemChecked( COLUMN_POPUP_IDS + KrDetailedViewProperties::Extention, hasExtention );
@ -1463,18 +1464,18 @@ void KrDetailedView::selectColumns()
popup.setItemChecked( COLUMN_POPUP_IDS + KrDetailedViewProperties::Permissions, hasPerms ); popup.setItemChecked( COLUMN_POPUP_IDS + KrDetailedViewProperties::Permissions, hasPerms );
popup.insertItem( i18n( "rwx" ), COLUMN_POPUP_IDS + KrDetailedViewProperties::KrPermissions ); popup.insertItem( i18n( "rwx" ), COLUMN_POPUP_IDS + KrDetailedViewProperties::KrPermissions );
popup.setItemChecked( COLUMN_POPUP_IDS + KrDetailedViewProperties::KrPermissions, hasKrPerms ); popup.setItemChecked( COLUMN_POPUP_IDS + KrDetailedViewProperties::KrPermissions, hasKrPerms );
popup.insertItem( i18n( "Owner" ), COLUMN_POPUP_IDS + KrDetailedViewProperties::Owner ); popup.insertItem( i18n( "Owner" ), COLUMN_POPUP_IDS + KrDetailedViewProperties::Owner );
popup.setItemChecked( COLUMN_POPUP_IDS + KrDetailedViewProperties::Owner, hasOwner ); popup.setItemChecked( COLUMN_POPUP_IDS + KrDetailedViewProperties::Owner, hasOwner );
popup.insertItem( i18n( "Group" ), COLUMN_POPUP_IDS + KrDetailedViewProperties::Group ); popup.insertItem( i18n( "Group" ), COLUMN_POPUP_IDS + KrDetailedViewProperties::Group );
popup.setItemChecked( COLUMN_POPUP_IDS + KrDetailedViewProperties::Group, hasGroup ); popup.setItemChecked( COLUMN_POPUP_IDS + KrDetailedViewProperties::Group, hasGroup );
int result=popup.exec(TQCursor::pos()); int result=popup.exec(TQCursor::pos());
krConfig->setGroup( nameInTDEConfig() ); krConfig->setGroup( nameInTDEConfig() );
switch( result - COLUMN_POPUP_IDS ) switch( result - COLUMN_POPUP_IDS )
{ {
case KrDetailedViewProperties::Extention: case KrDetailedViewProperties::Extention:
@ -1510,7 +1511,7 @@ void KrDetailedView::selectColumns()
refresh = true; refresh = true;
break; break;
} }
if( refresh ) if( refresh )
{ {
PanelManager *p = ACTIVE_PANEL->view == this ? ACTIVE_MNG : OTHER_MNG; PanelManager *p = ACTIVE_PANEL->view == this ? ACTIVE_MNG : OTHER_MNG;
@ -1523,7 +1524,7 @@ void KrDetailedView::sortOrderChanged(int) {
} }
void KrDetailedView::updateView() { void KrDetailedView::updateView() {
triggerUpdate(); triggerUpdate();
op()->emitSelectionChanged(); op()->emitSelectionChanged();
} }
@ -1564,7 +1565,7 @@ void KrDetailedView::slotSortOrderChanged(int col) {
sp = KrViewProperties::Group; break; sp = KrViewProperties::Group; break;
default: tqFatal("slotSortOrderChanged: unknown column"); default: tqFatal("slotSortOrderChanged: unknown column");
} }
if (sortMode() & KrViewProperties::DirsFirst) if (sortMode() & KrViewProperties::DirsFirst)
sp = static_cast<KrViewProperties::SortSpec>(sp | KrViewProperties::DirsFirst); sp = static_cast<KrViewProperties::SortSpec>(sp | KrViewProperties::DirsFirst);
if (sortMode() & KrViewProperties::IgnoreCase) if (sortMode() & KrViewProperties::IgnoreCase)
sp = static_cast<KrViewProperties::SortSpec>(sp | KrViewProperties::IgnoreCase); sp = static_cast<KrViewProperties::SortSpec>(sp | KrViewProperties::IgnoreCase);
@ -1574,12 +1575,12 @@ void KrDetailedView::slotSortOrderChanged(int col) {
sp = static_cast<KrViewProperties::SortSpec>(sp | KrViewProperties::AlwaysSortDirsByName); sp = static_cast<KrViewProperties::SortSpec>(sp | KrViewProperties::AlwaysSortDirsByName);
// fix the ascending/decending stuff // fix the ascending/decending stuff
if (sortMode() == sp) { if (sortMode() == sp) {
if (sp & KrViewProperties::Descending) if (sp & KrViewProperties::Descending)
sp = static_cast<KrViewProperties::SortSpec>(sp &~ KrViewProperties::Descending); sp = static_cast<KrViewProperties::SortSpec>(sp &~ KrViewProperties::Descending);
else sp = static_cast<KrViewProperties::SortSpec>(sp | KrViewProperties::Descending); else sp = static_cast<KrViewProperties::SortSpec>(sp | KrViewProperties::Descending);
} }
PROPS->sortMode = sp; PROPS->sortMode = sp;
if( !_focused ) if( !_focused )
op()->emitNeedFocus(); op()->emitNeedFocus();
} }

@ -8,13 +8,14 @@
#define PROPS static_cast<const KrViewProperties*>(_viewProperties) #define PROPS static_cast<const KrViewProperties*>(_viewProperties)
TQString atomicExtensions[] = { TQString atomicExtensions[] = {
".tar.gz", ".tar.gz",
".tar.bz2", ".tar.bz2",
".moc.cpp" ".moc.cpp"
".tar.xz",
}; };
KrViewItem::KrViewItem(vfile *vf, const KrViewProperties* properties): KrViewItem::KrViewItem(vfile *vf, const KrViewProperties* properties):
_vf(vf), dummyVfile(false), _viewProperties(properties), _hasExtension(false), _hidden(false), _extension("") { _vf(vf), dummyVfile(false), _viewProperties(properties), _hasExtension(false), _hidden(false), _extension("") {
if (vf) { if (vf) {
// check if the file has an extension // check if the file has an extension
@ -32,7 +33,7 @@ KrViewItem::KrViewItem(vfile *vf, const KrViewProperties* properties):
_extension = vfName.mid(loc+1); _extension = vfName.mid(loc+1);
_hasExtension=true; _hasExtension=true;
} }
if( vfName.startsWith(".") ) if( vfName.startsWith(".") )
_hidden = true; _hidden = true;
} }
@ -50,16 +51,16 @@ TQString KrViewItem::description() const {
TQString comment = KMimeType::mimeType(_vf->vfile_getMime())->comment(text, false); TQString comment = KMimeType::mimeType(_vf->vfile_getMime())->comment(text, false);
TQString myLinkDest = _vf->vfile_getSymDest(); TQString myLinkDest = _vf->vfile_getSymDest();
TDEIO::filesize_t mySize = _vf->vfile_getSize(); TDEIO::filesize_t mySize = _vf->vfile_getSize();
TQString text2 = text.copy(); TQString text2 = text.copy();
mode_t m_fileMode = _vf->vfile_getMode(); mode_t m_fileMode = _vf->vfile_getMode();
if (_vf->vfile_isSymLink() ){ if (_vf->vfile_isSymLink() ){
TQString tmp; TQString tmp;
if ( comment.isEmpty() ) tmp = i18n ( "Symbolic Link" ) ; if ( comment.isEmpty() ) tmp = i18n ( "Symbolic Link" ) ;
else if( _vf->vfile_getMime() == "Broken Link !" ) tmp = i18n("(broken link !)"); else if( _vf->vfile_getMime() == "Broken Link !" ) tmp = i18n("(broken link !)");
else tmp = i18n("%1 (Link)").arg(comment); else tmp = i18n("%1 (Link)").arg(comment);
text += "->"; text += "->";
text += myLinkDest; text += myLinkDest;
text += " "; text += " ";
@ -89,13 +90,13 @@ TQString KrViewItem::dateTime() const {
} }
TQPixmap KrViewItem::icon() { TQPixmap KrViewItem::icon() {
#if 0 #if 0
TQPixmap *p; TQPixmap *p;
// This is bad - very bad. the function must return a valid reference, // This is bad - very bad. the function must return a valid reference,
// This is an interface flow - shie please fix it with a function that return TQPixmap* // This is an interface flow - shie please fix it with a function that return TQPixmap*
// this way we can return 0 - and do our error checking... // this way we can return 0 - and do our error checking...
// shie answers: why? what's the difference? if we return an empty pixmap, others can use it as it // shie answers: why? what's the difference? if we return an empty pixmap, others can use it as it
// is, without worrying or needing to do error checking. empty pixmap displays nothing // is, without worrying or needing to do error checking. empty pixmap displays nothing
#endif #endif

@ -5,10 +5,10 @@ copyright : (C) 2000 by Shie Erlich & Rafi Yanai
e-mail : krusader@users.sourceforge.net e-mail : krusader@users.sourceforge.net
web site : http://krusader.sourceforge.net web site : http://krusader.sourceforge.net
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
Description Description
*************************************************************************** ***************************************************************************
A A
db dD d8888b. db db .d8888. .d8b. d8888b. d88888b d8888b. db dD d8888b. db db .d8888. .d8b. d8888b. d88888b d8888b.
88 ,8P' 88 `8D 88 88 88' YP d8' `8b 88 `8D 88' 88 `8D 88 ,8P' 88 `8D 88 88 88' YP d8' `8b 88 `8D 88' 88 `8D
@ -27,12 +27,12 @@ A
* (at your option) any later version. * * (at your option) any later version. *
* * * *
***************************************************************************/ ***************************************************************************/
#include <unistd.h> #include <unistd.h>
// TQt Includes // TQt Includes
#include <tqdir.h> #include <tqdir.h>
#include <tqtextstream.h> #include <tqtextstream.h>
#include <tqeventloop.h> #include <tqeventloop.h>
#include <tqclipboard.h> #include <tqclipboard.h>
// KDE Includes // KDE Includes
#include <tdelocale.h> #include <tdelocale.h>
#include <kprocess.h> #include <kprocess.h>
@ -48,7 +48,7 @@ A
#include <kdebug.h> #include <kdebug.h>
#include <tdeio/netaccess.h> #include <tdeio/netaccess.h>
#include <kstandarddirs.h> #include <kstandarddirs.h>
#include <ktempdir.h> #include <ktempdir.h>
#include <kurlrequester.h> #include <kurlrequester.h>
#include <kprocio.h> #include <kprocio.h>
#include <kdesktopfile.h> #include <kdesktopfile.h>
@ -91,7 +91,7 @@ panel( parent ), inRefresh( false ), vfsP( 0 ) {
} }
void ListPanelFunc::openUrl( const TQString& url, const TQString& nameToMakeCurrent ) { void ListPanelFunc::openUrl( const TQString& url, const TQString& nameToMakeCurrent ) {
openUrl( vfs::fromPathOrURL( openUrl( vfs::fromPathOrURL(
// KURLRequester is buggy: it should return a string containing "/home/shie/downloads" // KURLRequester is buggy: it should return a string containing "/home/shie/downloads"
// but it returns "~/downloads" which is parsed incorrectly by vfs::fromPathOrURL. // but it returns "~/downloads" which is parsed incorrectly by vfs::fromPathOrURL.
// replacedPath should replace ONLY $HOME and environment variables // replacedPath should replace ONLY $HOME and environment variables
@ -121,7 +121,7 @@ void ListPanelFunc::immediateOpenUrl( const KURL& urlIn ) {
// if we are not refreshing to current URL // if we are not refreshing to current URL
bool is_equal_url = files() ->vfs_getOrigin().equals( url, true ); bool is_equal_url = files() ->vfs_getOrigin().equals( url, true );
if ( !is_equal_url ) { if ( !is_equal_url ) {
// change the cursor to busy // change the cursor to busy
panel->setCursor( KCursor::waitCursor() ); panel->setCursor( KCursor::waitCursor() );
@ -135,7 +135,7 @@ void ListPanelFunc::immediateOpenUrl( const KURL& urlIn ) {
if ( is_equal_url ) { if ( is_equal_url ) {
panel->view->setCurrentItem( nameToMakeCurrent ); panel->view->setCurrentItem( nameToMakeCurrent );
panel->view->makeItemVisible( panel->view->getCurrentKrViewItem() ); panel->view->makeItemVisible( panel->view->getCurrentKrViewItem() );
} }
} }
vfs* v = 0; vfs* v = 0;
@ -152,11 +152,11 @@ void ListPanelFunc::immediateOpenUrl( const KURL& urlIn ) {
if ( !v ) if ( !v )
continue; //this should not happen ! continue; //this should not happen !
if ( v != vfsP ) { if ( v != vfsP ) {
if( vfsP->vfs_canDelete() ) if( vfsP->vfs_canDelete() )
delete vfsP; delete vfsP;
else { else {
connect( vfsP, TQT_SIGNAL( deleteAllowed() ), vfsP, TQT_SLOT( deleteLater() ) ); connect( vfsP, TQT_SIGNAL( deleteAllowed() ), vfsP, TQT_SLOT( deleteLater() ) );
vfsP->vfs_requestDelete(); vfsP->vfs_requestDelete();
} }
vfsP = v; // v != 0 so this is safe vfsP = v; // v != 0 so this is safe
} else { } else {
@ -173,10 +173,10 @@ void ListPanelFunc::immediateOpenUrl( const KURL& urlIn ) {
break; // we have a valid refreshed URL now break; // we have a valid refreshed URL now
} }
if ( vfsP == 0 ) // the object was deleted during vfs_refresh? Hoping the best... if ( vfsP == 0 ) // the object was deleted during vfs_refresh? Hoping the best...
return; return;
// prevent repeated error messages // prevent repeated error messages
if ( vfsP->vfs_isDeleting() ) if ( vfsP->vfs_isDeleting() )
break; break;
vfsP->vfs_setQuiet( true ); vfsP->vfs_setQuiet( true );
} }
vfsP->vfs_setQuiet( false ); vfsP->vfs_setQuiet( false );
@ -204,12 +204,12 @@ void ListPanelFunc::immediateOpenUrl( const KURL& urlIn ) {
panel, TQT_SLOT( slotItemDeleted( const TQString& ) ) ); panel, TQT_SLOT( slotItemDeleted( const TQString& ) ) );
connect( files(), TQT_SIGNAL( cleared() ), connect( files(), TQT_SIGNAL( cleared() ),
panel, TQT_SLOT( slotCleared() ) ); panel, TQT_SLOT( slotCleared() ) );
// on local file system change the working directory // on local file system change the working directory
if ( files() ->vfs_getType() == vfs::NORMAL ) if ( files() ->vfs_getType() == vfs::NORMAL )
chdir( files() ->vfs_getOrigin().path().local8Bit() ); chdir( files() ->vfs_getOrigin().path().local8Bit() );
// see if the open url operation failed, and if so, // see if the open url operation failed, and if so,
// put the attempted url in the origin bar and let the user change it // put the attempted url in the origin bar and let the user change it
if (refreshFailed) { if (refreshFailed) {
panel->origin->setURL(urlIn.prettyURL()); panel->origin->setURL(urlIn.prettyURL());
@ -529,25 +529,25 @@ void ListPanelFunc::mkdir() {
KURL ListPanelFunc::getVirtualBaseURL() { KURL ListPanelFunc::getVirtualBaseURL() {
if( files()->vfs_getType() != vfs::VIRT || otherFunc()->files()->vfs_getType() == vfs::VIRT ) if( files()->vfs_getType() != vfs::VIRT || otherFunc()->files()->vfs_getType() == vfs::VIRT )
return KURL(); return KURL();
TQStringList fileNames; TQStringList fileNames;
panel->getSelectedNames( &fileNames ); panel->getSelectedNames( &fileNames );
KURL::List* fileUrls = files() ->vfs_getFiles( &fileNames ); KURL::List* fileUrls = files() ->vfs_getFiles( &fileNames );
if( fileUrls->count() == 0 ) if( fileUrls->count() == 0 )
return KURL(); return KURL();
KURL base = (*fileUrls)[ 0 ].upURL(); KURL base = (*fileUrls)[ 0 ].upURL();
if( base.protocol() == "virt" ) // is it a virtual subfolder? if( base.protocol() == "virt" ) // is it a virtual subfolder?
return KURL(); // --> cannot keep the directory structure return KURL(); // --> cannot keep the directory structure
for( unsigned i=1; i < fileUrls->count(); i++ ) { for( unsigned i=1; i < fileUrls->count(); i++ ) {
if( base.isParentOf( (*fileUrls)[ i ] ) ) if( base.isParentOf( (*fileUrls)[ i ] ) )
continue; continue;
if( base.protocol() != (*fileUrls)[ i ].protocol() ) if( base.protocol() != (*fileUrls)[ i ].protocol() )
return KURL(); return KURL();
do { do {
KURL oldBase = base; KURL oldBase = base;
base = base.upURL(); base = base.upURL();
@ -721,15 +721,13 @@ void ListPanelFunc::execute( TQString& name ) {
dirUp(); dirUp();
return ; return ;
} }
vfile *vf = files() ->vfs_search( name ); vfile *vf = files() ->vfs_search( name );
if ( vf == 0 ) if ( vf == 0 )
return ; return ;
KURL origin = files() ->vfs_getOrigin(); KURL origin = files() ->vfs_getOrigin();
TQString protocol = origin.isLocalFile() ? KrServices::registerdProtocol( vf->vfile_getMime() ) : ""; TQString protocol = origin.isLocalFile() ? KrServices::registerdProtocol( vf->vfile_getMime() ) : "";
if ( protocol == "tar" || protocol == "krarc" ) { if ( protocol == "tar" || protocol == "krarc" ) {
bool encrypted; bool encrypted;
TQString type = KRarcHandler::getType( encrypted, vf->vfile_getUrl().path(), vf->vfile_getMime(), false ); TQString type = KRarcHandler::getType( encrypted, vf->vfile_getUrl().path(), vf->vfile_getMime(), false );
@ -748,7 +746,7 @@ void ListPanelFunc::execute( TQString& name ) {
} else { } else {
KURL url = files() ->vfs_getFile( name ); KURL url = files() ->vfs_getFile( name );
KFileItem kfi( vf->vfile_getEntry(), url,true ); KFileItem kfi( vf->vfile_getEntry(), url,true );
kfi.run(); kfi.run();
} }
} }
@ -776,15 +774,15 @@ void ListPanelFunc::pack() {
if ( PackGUI::type == TQString() ) if ( PackGUI::type == TQString() )
return ; // the user canceled return ; // the user canceled
// check for partial URLs // check for partial URLs
if( !PackGUI::destination.contains(":/") && !PackGUI::destination.startsWith("/") ){ if( !PackGUI::destination.contains(":/") && !PackGUI::destination.startsWith("/") ){
PackGUI::destination = panel->virtualPath().prettyURL()+"/"+PackGUI::destination; PackGUI::destination = panel->virtualPath().prettyURL()+"/"+PackGUI::destination;
} }
TQString destDir = PackGUI::destination; TQString destDir = PackGUI::destination;
if( !destDir.endsWith( "/" ) ) if( !destDir.endsWith( "/" ) )
destDir += "/"; destDir += "/";
bool packToOtherPanel = ( destDir == panel->otherPanel->virtualPath().prettyURL(1) ); bool packToOtherPanel = ( destDir == panel->otherPanel->virtualPath().prettyURL(1) );
// on remote URL-s first pack into a temp file then copy to its right place // on remote URL-s first pack into a temp file then copy to its right place
@ -795,8 +793,8 @@ void ListPanelFunc::pack() {
arcFile = destURL.path(); arcFile = destURL.path();
else if( destURL.protocol() == "virt" ) { else if( destURL.protocol() == "virt" ) {
KMessageBox::error( krApp, i18n( "Cannot pack files onto a virtual destination!" ) ); KMessageBox::error( krApp, i18n( "Cannot pack files onto a virtual destination!" ) );
return; return;
} }
else { else {
tempDestFile = new KTempFile( TQString(), "." + PackGUI::type ); tempDestFile = new KTempFile( TQString(), "." + PackGUI::type );
tempDestFile->setAutoDelete( true ); tempDestFile->setAutoDelete( true );
@ -884,15 +882,15 @@ void ListPanelFunc::testArchive() {
TQString mime = files() ->vfs_search( arcName ) ->vfile_getMime(); TQString mime = files() ->vfs_search( arcName ) ->vfile_getMime();
bool encrypted = false; bool encrypted = false;
TQString type = KRarcHandler::getType( encrypted, url, mime ); TQString type = KRarcHandler::getType( encrypted, url, mime );
// check we that archive is supported // check we that archive is supported
if ( !KRarcHandler::arcSupported( type ) ) { if ( !KRarcHandler::arcSupported( type ) ) {
KMessageBox::sorry( krApp, i18n( "%1, unknown archive type." ).arg( arcName ) ); KMessageBox::sorry( krApp, i18n( "%1, unknown archive type." ).arg( arcName ) );
return ; return ;
} }
TQString password = encrypted ? KRarcHandler::getPassword( url ) : TQString(); TQString password = encrypted ? KRarcHandler::getPassword( url ) : TQString();
// test the archive // test the archive
if ( KRarcHandler::test( url, type, password ) ) if ( KRarcHandler::test( url, type, password ) )
KMessageBox::information( krApp, i18n( "%1, test passed." ).arg( arcName ) ); KMessageBox::information( krApp, i18n( "%1, test passed." ).arg( arcName ) );
@ -964,9 +962,9 @@ void ListPanelFunc::unpack() {
KMessageBox::sorry( krApp, i18n( "%1, unknown archive type" ).arg( arcName ) ); KMessageBox::sorry( krApp, i18n( "%1, unknown archive type" ).arg( arcName ) );
continue; continue;
} }
TQString password = encrypted ? KRarcHandler::getPassword( url ) : TQString(); TQString password = encrypted ? KRarcHandler::getPassword( url ) : TQString();
// unpack the files // unpack the files
KRarcHandler::unpack( url, type, password, dest.path( -1 ) ); KRarcHandler::unpack( url, type, password, dest.path( -1 ) );
@ -1020,7 +1018,7 @@ void ListPanelFunc::matchChecksum() {
TQValueList<vfile*> checksumFiles = files()->vfs_search( TQValueList<vfile*> checksumFiles = files()->vfs_search(
KRQuery(MatchChecksumDlg::checksumTypesFilter) KRQuery(MatchChecksumDlg::checksumTypesFilter)
); );
MatchChecksumDlg dlg(args, folders, panel->realPath(), MatchChecksumDlg dlg(args, folders, panel->realPath(),
(checksumFiles.size()==1 ? checksumFiles[0]->vfile_getUrl().prettyURL() : TQString())); (checksumFiles.size()==1 ? checksumFiles[0]->vfile_getUrl().prettyURL() : TQString()));
} }
@ -1149,7 +1147,7 @@ void ListPanelFunc::copyToClipboard( bool move ) {
KMessageBox::error( krApp, i18n( "Cannot copy a virtual URL collection onto the clipboard!" ) ); KMessageBox::error( krApp, i18n( "Cannot copy a virtual URL collection onto the clipboard!" ) );
return; return;
} }
TQStringList fileNames; TQStringList fileNames;
panel->getSelectedNames( &fileNames ); panel->getSelectedNames( &fileNames );
@ -1160,10 +1158,10 @@ void ListPanelFunc::copyToClipboard( bool move ) {
if ( fileUrls ) { if ( fileUrls ) {
KRDrag * urlData = KRDrag::newDrag( *fileUrls, move, krApp->mainView, "krusader" ); KRDrag * urlData = KRDrag::newDrag( *fileUrls, move, krApp->mainView, "krusader" );
TQApplication::clipboard() ->setData( urlData ); TQApplication::clipboard() ->setData( urlData );
if( move && files()->vfs_getType() == vfs::VIRT ) if( move && files()->vfs_getType() == vfs::VIRT )
( static_cast<virt_vfs*>( files() ) )->vfs_removeFiles( &fileNames ); ( static_cast<virt_vfs*>( files() ) )->vfs_removeFiles( &fileNames );
delete fileUrls; delete fileUrls;
} }
} }

@ -26,15 +26,15 @@
* the Free Software Foundation; either version 2 of the License, or * * the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. * * (at your option) any later version. *
* * * *
***************************************************************************/ ***************************************************************************/
// QT includes // QT includes
#include <tqtextstream.h> #include <tqtextstream.h>
// KDE includes // KDE includes
#include <kprocess.h> #include <kprocess.h>
#include <tdetempfile.h> #include <tdetempfile.h>
#include <tdelocale.h> #include <tdelocale.h>
#include <tdemessagebox.h> #include <tdemessagebox.h>
#include <tdeio/passdlg.h> #include <tdeio/passdlg.h>
#include <tqfile.h> #include <tqfile.h>
#include <kstandarddirs.h> #include <kstandarddirs.h>
#include <ktar.h> #include <ktar.h>
@ -46,7 +46,7 @@
#include "../krservices.h" #include "../krservices.h"
#include "../Dialogs/krpleasewait.h" #include "../Dialogs/krpleasewait.h"
static TQStringList arcProtocols = TQStringList::split(";", "tar;bzip;bzip2;gzip;krarc;zip"); static TQStringList arcProtocols = TQStringList::split(";", "tar;bzip;bzip2;gzip;krarc;zip;xz");
TDEWallet::Wallet * KRarcHandler::wallet = 0; TDEWallet::Wallet * KRarcHandler::wallet = 0;
@ -69,6 +69,7 @@ TQStringList KRarcHandler::supportedPackers() {
if ( KrServices::cmdExist( "dpkg" ) ) packers.append( "dpkg" ); if ( KrServices::cmdExist( "dpkg" ) ) packers.append( "dpkg" );
if ( KrServices::cmdExist( "7z" ) || KrServices::cmdExist( "7za" ) ) packers.append( "7z" ); if ( KrServices::cmdExist( "7z" ) || KrServices::cmdExist( "7za" ) ) packers.append( "7z" );
if ( KrServices::cmdExist( "rpm" ) && KrServices::cmdExist( "rpm2cpio" ) ) packers.append( "rpm" ); if ( KrServices::cmdExist( "rpm" ) && KrServices::cmdExist( "rpm2cpio" ) ) packers.append( "rpm" );
if ( KrServices::cmdExist( "xz" ) ) packers.append( "xz" );
// kdDebug() << "Supported Packers:" << endl; // kdDebug() << "Supported Packers:" << endl;
//TQStringList::Iterator it; //TQStringList::Iterator it;
//for( it = packers.begin(); it != packers.end(); ++it ) //for( it = packers.begin(); it != packers.end(); ++it )
@ -90,6 +91,8 @@ bool KRarcHandler::arcSupported( TQString type ) {
return true; return true;
else if ( type == "-tgz" && lst.contains( "tar" ) ) else if ( type == "-tgz" && lst.contains( "tar" ) )
return true; return true;
else if ( type == "-txz" && lst.contains( "tar" ) )
return true;
else if ( type == "tarz" && lst.contains( "tar" ) ) else if ( type == "tarz" && lst.contains( "tar" ) )
return true; return true;
else if ( type == "gzip" && lst.contains( "gzip" ) ) else if ( type == "gzip" && lst.contains( "gzip" ) )
@ -110,7 +113,9 @@ bool KRarcHandler::arcSupported( TQString type ) {
return true; return true;
else if ( type == "-deb" && ( lst.contains( "dpkg" ) && lst.contains( "tar" ) ) ) else if ( type == "-deb" && ( lst.contains( "dpkg" ) && lst.contains( "tar" ) ) )
return true; return true;
else if ( type == "-7z" && lst.contains( "7z" ) ) else if ( type == "-7z" && lst.contains( "7z" ) )
return true;
else if ( type == "-xz" && lst.contains( "xz" ) )
return true; return true;
// not supported : ( // not supported : (
return false; return false;
@ -123,19 +128,21 @@ bool KRarcHandler::arcHandled( TQString type ) {
krConfig->setGroup( "Archives" ); krConfig->setGroup( "Archives" );
if ( ( type == "-tgz" && krConfig->readBoolEntry( "Do GZip" , _DoGZip ) ) || if ( ( type == "-tgz" && krConfig->readBoolEntry( "Do GZip" , _DoGZip ) ) ||
( type == "tarz" && krConfig->readBoolEntry( "Do GZip" , _DoGZip ) ) || ( type == "tarz" && krConfig->readBoolEntry( "Do GZip" , _DoGZip ) ) ||
( type == "-tar" && krConfig->readBoolEntry( "Do Tar" , _DoTar ) ) || ( type == "-tar" && krConfig->readBoolEntry( "Do Tar" , _DoTar ) ) ||
( type == "-tbz" && krConfig->readBoolEntry( "Do BZip2", _DoBZip2 ) ) || ( type == "-tbz" && krConfig->readBoolEntry( "Do BZip2", _DoBZip2 ) ) ||
( type == "-txz" && krConfig->readBoolEntry( "Do Xz" , _DoXz ) ) ||
( type == "gzip" && krConfig->readBoolEntry( "Do GZip" , _DoGZip ) ) || ( type == "gzip" && krConfig->readBoolEntry( "Do GZip" , _DoGZip ) ) ||
( type == "zip2" && krConfig->readBoolEntry( "Do BZip2", _DoBZip2 ) ) || ( type == "zip2" && krConfig->readBoolEntry( "Do BZip2", _DoBZip2 ) ) ||
( type == "-zip" && krConfig->readBoolEntry( "Do UnZip", _DoUnZip ) ) || ( type == "-zip" && krConfig->readBoolEntry( "Do UnZip", _DoUnZip ) ) ||
( type == "-lha" && krConfig->readBoolEntry( "Do Lha", _DoUnZip ) ) || ( type == "-lha" && krConfig->readBoolEntry( "Do Lha" , _DoUnZip ) ) ||
( type == "-rar" && krConfig->readBoolEntry( "Do UnRar", _DoUnRar ) ) || ( type == "-rar" && krConfig->readBoolEntry( "Do UnRar", _DoUnRar ) ) ||
( type == "-arj" && krConfig->readBoolEntry( "Do UnArj", _DoUnarj ) ) || ( type == "-arj" && krConfig->readBoolEntry( "Do UnArj", _DoUnarj ) ) ||
( type == "-ace" && krConfig->readBoolEntry( "Do UnAce", _DoUnAce ) ) || ( type == "-ace" && krConfig->readBoolEntry( "Do UnAce", _DoUnAce ) ) ||
( type == "cpio" && krConfig->readBoolEntry( "Do RPM" , _DoRPM ) ) || ( type == "cpio" && krConfig->readBoolEntry( "Do RPM" , _DoRPM ) ) ||
( type == "-rpm" && krConfig->readBoolEntry( "Do RPM" , _DoRPM ) ) || ( type == "-rpm" && krConfig->readBoolEntry( "Do RPM" , _DoRPM ) ) ||
( type == "-deb" && krConfig->readBoolEntry( "Do DEB" , _DoDEB ) ) || ( type == "-deb" && krConfig->readBoolEntry( "Do DEB" , _DoDEB ) ) ||
( type == "-7z" && krConfig->readBoolEntry( "Do 7z" , _Do7z ) ) ) ( type == "-7z" && krConfig->readBoolEntry( "Do 7z" , _Do7z ) ) ||
( type == "-xz" && krConfig->readBoolEntry( "Do Xz" , _DoXz ) ) )
return true; return true;
else else
return false; return false;
@ -148,8 +155,8 @@ long KRarcHandler::arcFileCount( TQString archive, TQString type, TQString passw
// first check if supported // first check if supported
if ( !arcSupported( type ) ) return 0; if ( !arcSupported( type ) ) return 0;
// bzip an gzip archive contains only one file // bzip, gzip and xz archives contain only one file
if ( type == "zip2" || type == "gzip" ) return 1L; if ( type == "zip2" || type == "gzip" || type == "-xz") return 1L;
// set the right lister to do the job // set the right lister to do the job
TQString lister; TQString lister;
@ -159,6 +166,7 @@ long KRarcHandler::arcFileCount( TQString archive, TQString type, TQString passw
else if ( type == "-tgz" ) lister = KrServices::fullPathName( "tar" ) + " -tvzf"; else if ( type == "-tgz" ) lister = KrServices::fullPathName( "tar" ) + " -tvzf";
else if ( type == "tarz" ) lister = KrServices::fullPathName( "tar" ) + " -tvzf"; else if ( type == "tarz" ) lister = KrServices::fullPathName( "tar" ) + " -tvzf";
else if ( type == "-tbz" ) lister = KrServices::fullPathName( "tar" ) + " -tjvf"; else if ( type == "-tbz" ) lister = KrServices::fullPathName( "tar" ) + " -tjvf";
else if ( type == "-txz" ) lister = KrServices::fullPathName( "tar" ) + " -tJvf";
else if ( type == "-lha" ) lister = KrServices::fullPathName( "lha" ) + " l"; else if ( type == "-lha" ) lister = KrServices::fullPathName( "lha" ) + " l";
else if ( type == "-rar" ) lister = KrServices::fullPathName( KrServices::cmdExist( "rar" ) ? "rar" : "unrar" ) + " l -v"; else if ( type == "-rar" ) lister = KrServices::fullPathName( KrServices::cmdExist( "rar" ) ? "rar" : "unrar" ) + " l -v";
else if ( type == "-ace" ) lister = KrServices::fullPathName( "unace" ) + " l"; else if ( type == "-ace" ) lister = KrServices::fullPathName( "unace" ) + " l";
@ -171,8 +179,9 @@ long KRarcHandler::arcFileCount( TQString archive, TQString type, TQString passw
else if ( type == "-rpm" ) lister = KrServices::fullPathName( "rpm" ) + " --dump -lpq"; else if ( type == "-rpm" ) lister = KrServices::fullPathName( "rpm" ) + " --dump -lpq";
else if ( type == "-deb" ) lister = KrServices::fullPathName( "dpkg" ) + " -c"; else if ( type == "-deb" ) lister = KrServices::fullPathName( "dpkg" ) + " -c";
else if ( type == "-7z" ) lister = KrServices::fullPathName( "7z" ) + " -y l"; else if ( type == "-7z" ) lister = KrServices::fullPathName( "7z" ) + " -y l";
else if ( type == "-xz" ) lister = KrServices::fullPathName( "xz" ) + " -l";
else return 0L; else return 0L;
if ( !password.isNull() ) { if ( !password.isNull() ) {
if ( type == "-arj" ) if ( type == "-arj" )
lister += " -g'" + password + "'"; lister += " -g'" + password + "'";
@ -198,11 +207,11 @@ long KRarcHandler::arcFileCount( TQString archive, TQString type, TQString passw
list.kill(); list.kill();
} }
; // busy wait - need to find something better... ; // busy wait - need to find something better...
krApp->stopWait(); krApp->stopWait();
if( !list.normalExit() || !checkStatus( type, list.exitStatus() ) ) { if( !list.normalExit() || !checkStatus( type, list.exitStatus() ) ) {
KMessageBox::detailedError (krApp, i18n( "Failed to list the content of the archive (%1)!" ).arg( archive ), KMessageBox::detailedError (krApp, i18n( "Failed to list the content of the archive (%1)!" ).arg( archive ),
list.getErrorMsg(), i18n("Error" ) ); list.getErrorMsg(), i18n("Error" ) );
return 0; return 0;
} }
@ -241,6 +250,7 @@ bool KRarcHandler::unpack( TQString archive, TQString type, TQString password, T
else if ( type == "-tgz" ) packer = KrServices::fullPathName( "tar" ) + " -xvzf"; else if ( type == "-tgz" ) packer = KrServices::fullPathName( "tar" ) + " -xvzf";
else if ( type == "tarz" ) packer = KrServices::fullPathName( "tar" ) + " -xvzf"; else if ( type == "tarz" ) packer = KrServices::fullPathName( "tar" ) + " -xvzf";
else if ( type == "-tbz" ) packer = KrServices::fullPathName( "tar" ) + " -xjvf"; else if ( type == "-tbz" ) packer = KrServices::fullPathName( "tar" ) + " -xjvf";
else if ( type == "-txz" ) packer = KrServices::fullPathName( "tar" ) + " -xJvf";
else if ( type == "gzip" ) packer = KrServices::fullPathName( "gzip" ) + " -cd"; else if ( type == "gzip" ) packer = KrServices::fullPathName( "gzip" ) + " -cd";
else if ( type == "zip2" ) packer = KrServices::fullPathName( "bzip2" ) + " -cdk"; else if ( type == "zip2" ) packer = KrServices::fullPathName( "bzip2" ) + " -cdk";
else if ( type == "-lha" ) packer = KrServices::fullPathName( "lha" ) + " xf"; else if ( type == "-lha" ) packer = KrServices::fullPathName( "lha" ) + " xf";
@ -250,6 +260,7 @@ bool KRarcHandler::unpack( TQString archive, TQString type, TQString password, T
KrServices::fullPathName( "arj" ) + " -y -v x" : KrServices::fullPathName( "arj" ) + " -y -v x" :
KrServices::fullPathName( "unarj" ) + " x"; KrServices::fullPathName( "unarj" ) + " x";
else if ( type == "-7z" ) packer = KrServices::fullPathName( "7z" ) + " -y x"; else if ( type == "-7z" ) packer = KrServices::fullPathName( "7z" ) + " -y x";
else if ( type == "-xz" ) packer = KrServices::fullPathName( "xz" ) + " -cdk";
else if ( type == "-rpm" ) { else if ( type == "-rpm" ) {
TQString tempDir = locateLocal("tmp",TQString()); TQString tempDir = locateLocal("tmp",TQString());
@ -259,11 +270,11 @@ bool KRarcHandler::unpack( TQString archive, TQString type, TQString password, T
cpio << KrServices::fullPathName( "rpm2cpio" ) << " " + KrServices::quote( archive ) << " > " << cpioName; cpio << KrServices::fullPathName( "rpm2cpio" ) << " " + KrServices::quote( archive ) << " > " << cpioName;
cpio.start(TDEProcess::Block, TDEProcess::AllOutput ); cpio.start(TDEProcess::Block, TDEProcess::AllOutput );
if( !cpio.normalExit() || !checkStatus( "cpio", cpio.exitStatus() ) ) { if( !cpio.normalExit() || !checkStatus( "cpio", cpio.exitStatus() ) ) {
KMessageBox::detailedError (krApp, i18n( "Failed to convert rpm (%1) to cpio!" ).arg( archive ), KMessageBox::detailedError (krApp, i18n( "Failed to convert rpm (%1) to cpio!" ).arg( archive ),
cpio.getErrorMsg(), i18n("Error" ) ); cpio.getErrorMsg(), i18n("Error" ) );
return 0; return 0;
} }
archive = cpioName; archive = cpioName;
packer = KrServices::fullPathName( "cpio" ) + " --force-local --no-absolute-filenames -iuvdF"; packer = KrServices::fullPathName( "cpio" ) + " --force-local --no-absolute-filenames -iuvdF";
} }
@ -276,18 +287,18 @@ bool KRarcHandler::unpack( TQString archive, TQString type, TQString password, T
dpkg << KrServices::fullPathName( "dpkg" ) << " --fsys-tarfile " + KrServices::quote( archive ) << " > " << cpioName; dpkg << KrServices::fullPathName( "dpkg" ) << " --fsys-tarfile " + KrServices::quote( archive ) << " > " << cpioName;
dpkg.start(TDEProcess::Block, TDEProcess::AllOutput ); dpkg.start(TDEProcess::Block, TDEProcess::AllOutput );
if( !dpkg.normalExit() || !checkStatus( "-deb", dpkg.exitStatus() ) ) { if( !dpkg.normalExit() || !checkStatus( "-deb", dpkg.exitStatus() ) ) {
KMessageBox::detailedError (krApp, i18n( "Failed to convert deb (%1) to tar!" ).arg( archive ), KMessageBox::detailedError (krApp, i18n( "Failed to convert deb (%1) to tar!" ).arg( archive ),
dpkg.getErrorMsg(), i18n("Error" ) ); dpkg.getErrorMsg(), i18n("Error" ) );
return 0; return 0;
} }
archive = cpioName; archive = cpioName;
packer = KrServices::fullPathName( "tar" ) + " xvf "; packer = KrServices::fullPathName( "tar" ) + " xvf ";
} }
else return false; else return false;
if ( !password.isNull() ) { if ( !password.isNull() ) {
if ( type == "-zip" ) if ( type == "-zip" )
packer += " -P '" + password + "'"; packer += " -P '" + password + "'";
if ( type == "-arj" ) if ( type == "-arj" )
packer += " -g'" + password + "'"; packer += " -g'" + password + "'";
@ -305,7 +316,7 @@ bool KRarcHandler::unpack( TQString archive, TQString type, TQString password, T
} }
if( type == "-ace" && TQFile( "/dev/ptmx" ).exists() ) // Don't remove, unace crashes if missing!!! if( type == "-ace" && TQFile( "/dev/ptmx" ).exists() ) // Don't remove, unace crashes if missing!!!
proc << "<" << "/dev/ptmx"; proc << "<" << "/dev/ptmx";
TQString save = getcwd( 0, 0 ); TQString save = getcwd( 0, 0 );
chdir( dest.local8Bit() ); chdir( dest.local8Bit() );
@ -333,11 +344,11 @@ bool KRarcHandler::unpack( TQString archive, TQString type, TQString password, T
if( !cpioName.isEmpty() ) if( !cpioName.isEmpty() )
TQFile( cpioName ).remove(); /* remove the cpio file */ TQFile( cpioName ).remove(); /* remove the cpio file */
// check the return value // check the return value
if ( !proc.normalExit() || !checkStatus( type, proc.exitStatus() ) ) { if ( !proc.normalExit() || !checkStatus( type, proc.exitStatus() ) ) {
KMessageBox::detailedError (krApp, i18n( "Failed to unpack %1!" ).arg( archive ), KMessageBox::detailedError (krApp, i18n( "Failed to unpack %1!" ).arg( archive ),
krApp->wasWaitingCancelled() ? i18n( "User cancelled." ) : krApp->wasWaitingCancelled() ? i18n( "User cancelled." ) :
proc.getErrorMsg(), i18n("Error" ) ); proc.getErrorMsg(), i18n("Error" ) );
return false; return false;
} }
@ -354,6 +365,7 @@ bool KRarcHandler::test( TQString archive, TQString type, TQString password, lon
else if ( type == "-tgz" ) packer = KrServices::fullPathName( "tar" ) + " -tvzf"; else if ( type == "-tgz" ) packer = KrServices::fullPathName( "tar" ) + " -tvzf";
else if ( type == "tarz" ) packer = KrServices::fullPathName( "tar" ) + " -tvzf"; else if ( type == "tarz" ) packer = KrServices::fullPathName( "tar" ) + " -tvzf";
else if ( type == "-tbz" ) packer = KrServices::fullPathName( "tar" ) + " -tjvf"; else if ( type == "-tbz" ) packer = KrServices::fullPathName( "tar" ) + " -tjvf";
else if ( type == "-txz" ) packer = KrServices::fullPathName( "tar" ) + " -tJvf";
else if ( type == "gzip" ) packer = KrServices::fullPathName( "gzip" ) + " -tv"; else if ( type == "gzip" ) packer = KrServices::fullPathName( "gzip" ) + " -tv";
else if ( type == "zip2" ) packer = KrServices::fullPathName( "bzip2" ) + " -tv"; else if ( type == "zip2" ) packer = KrServices::fullPathName( "bzip2" ) + " -tv";
else if ( type == "-rar" ) packer = KrServices::fullPathName( KrServices::cmdExist( "rar" ) ? "rar" : "unrar" ) + " t"; else if ( type == "-rar" ) packer = KrServices::fullPathName( KrServices::cmdExist( "rar" ) ? "rar" : "unrar" ) + " t";
@ -362,10 +374,11 @@ bool KRarcHandler::test( TQString archive, TQString type, TQString password, lon
else if ( type == "-arj" ) packer = KrServices::fullPathName( KrServices::cmdExist( "arj" ) ? "arj" : "unarj" ) + " t"; else if ( type == "-arj" ) packer = KrServices::fullPathName( KrServices::cmdExist( "arj" ) ? "arj" : "unarj" ) + " t";
else if ( type == "cpio" ) packer = KrServices::fullPathName( "cpio" ) + " --only-verify-crc -tvF" ; else if ( type == "cpio" ) packer = KrServices::fullPathName( "cpio" ) + " --only-verify-crc -tvF" ;
else if ( type == "-7z" ) packer = KrServices::fullPathName( "7z" ) + " -y t"; else if ( type == "-7z" ) packer = KrServices::fullPathName( "7z" ) + " -y t";
else if ( type == "-xz" ) packer = KrServices::fullPathName( "xz" ) + " -tv";
else return false; else return false;
if ( !password.isNull() ) { if ( !password.isNull() ) {
if ( type == "-zip" ) if ( type == "-zip" )
packer += " -P '" + password + "'"; packer += " -P '" + password + "'";
if ( type == "-arj" ) if ( type == "-arj" )
packer += " -g'" + password + "'"; packer += " -g'" + password + "'";
@ -379,7 +392,7 @@ bool KRarcHandler::test( TQString archive, TQString type, TQString password, lon
if( type == "-ace" && TQFile( "/dev/ptmx" ).exists() ) // Don't remove, unace crashes if missing!!! if( type == "-ace" && TQFile( "/dev/ptmx" ).exists() ) // Don't remove, unace crashes if missing!!!
proc << "<" << "/dev/ptmx"; proc << "<" << "/dev/ptmx";
// tell the user to wait // tell the user to wait
krApp->startWaiting( i18n( "Testing Archive" ), count, true ); krApp->startWaiting( i18n( "Testing Archive" ), count, true );
if ( count != 0 ) connect( &proc, TQT_SIGNAL( receivedStdout( TDEProcess*, char*, int ) ), if ( count != 0 ) connect( &proc, TQT_SIGNAL( receivedStdout( TDEProcess*, char*, int ) ),
@ -407,23 +420,25 @@ bool KRarcHandler::pack( TQStringList fileNames, TQString type, TQString dest, l
// set the right packer to do the job // set the right packer to do the job
TQString packer; TQString packer;
if ( type == "zip" ) { packer = KrServices::fullPathName( "zip" ) + " -ry"; type = "-zip"; } if ( type == "zip" ) { packer = KrServices::fullPathName( "zip" ) + " -ry"; type = "-zip"; }
else if ( type == "tar" ) { packer = KrServices::fullPathName( "tar" ) + " -cvf"; type = "-tar"; } else if ( type == "tar" ) { packer = KrServices::fullPathName( "tar" ) + " -cvf"; type = "-tar"; }
else if ( type == "tar.gz" ) { packer = KrServices::fullPathName( "tar" ) + " -cvzf"; type = "-tgz"; } else if ( type == "tar.gz" ) { packer = KrServices::fullPathName( "tar" ) + " -cvzf"; type = "-tgz"; }
else if ( type == "tar.bz2" ) { packer = KrServices::fullPathName( "tar" ) + " -cvjf"; type = "-tbz"; } else if ( type == "tar.bz2" ) { packer = KrServices::fullPathName( "tar" ) + " -cvjf"; type = "-tbz"; }
else if ( type == "rar" ) { packer = KrServices::fullPathName( "rar" ) + " -r a"; type = "-rar"; } else if ( type == "tar.xz" ) { packer = KrServices::fullPathName( "tar" ) + " -cvJf"; type = "-txz"; }
else if ( type == "lha" ) { packer = KrServices::fullPathName( "lha" ) + " a"; type = "-lha"; } else if ( type == "rar" ) { packer = KrServices::fullPathName( "rar" ) + " -r a"; type = "-rar"; }
else if ( type == "arj" ) { packer = KrServices::fullPathName( "arj" ) + " -r -y a"; type = "-arj"; } else if ( type == "lha" ) { packer = KrServices::fullPathName( "lha" ) + " a"; type = "-lha"; }
else if ( type == "7z" ) { packer = KrServices::fullPathName( "7z" ) + " -y a"; type = "-7z"; } else if ( type == "arj" ) { packer = KrServices::fullPathName( "arj" ) + " -r -y a"; type = "-arj"; }
else if ( type == "7z" ) { packer = KrServices::fullPathName( "7z" ) + " -y a"; type = "-7z"; }
else if ( type == "xz" ) { packer = KrServices::fullPathName( "xz" ) + " -z"; type = "-xz"; }
else return false; else return false;
TQString password = TQString(); TQString password = TQString();
if( extraProps.count( "Password" ) > 0 ) { if( extraProps.count( "Password" ) > 0 ) {
password = extraProps[ "Password" ]; password = extraProps[ "Password" ];
if ( !password.isNull() ) { if ( !password.isNull() ) {
if ( type == "-zip" ) if ( type == "-zip" )
packer += " -P '" + password + "'"; packer += " -P '" + password + "'";
else if ( type == "-arj" ) else if ( type == "-arj" )
packer += " -g'" + password + "'"; packer += " -g'" + password + "'";
@ -473,11 +488,15 @@ bool KRarcHandler::pack( TQStringList fileNames, TQString type, TQString dest, l
static const int sevenZipLevels[] = { 0, 1, 2, 4, 5, 6, 7, 8, 9 }; static const int sevenZipLevels[] = { 0, 1, 2, 4, 5, 6, 7, 8, 9 };
packer += TQString( " -mx%1" ).arg( sevenZipLevels[ level ] ); packer += TQString( " -mx%1" ).arg( sevenZipLevels[ level ] );
} }
else if( type == "-xz" ) {
static const int xzLevels[] = { 0, 1, 2, 4, 5, 6, 7, 8, 9 };
packer += TQString( " -%1" ).arg( xzLevels[ level ] );
}
} }
if( extraProps.count( "CommandLineSwitches" ) > 0 ) if( extraProps.count( "CommandLineSwitches" ) > 0 )
packer += TQString( " %1" ).arg( extraProps[ "CommandLineSwitches" ] ); packer += TQString( " %1" ).arg( extraProps[ "CommandLineSwitches" ] );
// prepare to pack // prepare to pack
KrShellProcess proc; KrShellProcess proc;
proc << packer << KrServices::quote( dest ); proc << packer << KrServices::quote( dest );
@ -505,8 +524,8 @@ bool KRarcHandler::pack( TQStringList fileNames, TQString type, TQString dest, l
// check the return value // check the return value
if ( !proc.normalExit() || !checkStatus( type, proc.exitStatus() ) ) { if ( !proc.normalExit() || !checkStatus( type, proc.exitStatus() ) ) {
KMessageBox::detailedError (krApp, i18n( "Failed to pack %1!" ).arg( dest ), KMessageBox::detailedError (krApp, i18n( "Failed to pack %1!" ).arg( dest ),
krApp->wasWaitingCancelled() ? i18n( "User cancelled." ) : proc.getErrorMsg(), krApp->wasWaitingCancelled() ? i18n( "User cancelled." ) : proc.getErrorMsg(),
i18n("Error" ) ); i18n("Error" ) );
return false; return false;
} }
@ -522,9 +541,9 @@ bool KRarcHandler::pack( TQStringList fileNames, TQString type, TQString dest, l
TQString KRarcHandler::getPassword( TQString path ) { TQString KRarcHandler::getPassword( TQString path ) {
TQString password; TQString password;
TQString key = "krarc-" + path; TQString key = "krarc-" + path;
if( !TDEWallet::Wallet::keyDoesNotExist(TDEWallet::Wallet::NetworkWallet(), TDEWallet::Wallet::PasswordFolder(), key ) ) { if( !TDEWallet::Wallet::keyDoesNotExist(TDEWallet::Wallet::NetworkWallet(), TDEWallet::Wallet::PasswordFolder(), key ) ) {
if( !TDEWallet::Wallet::isOpen( TDEWallet::Wallet::NetworkWallet() ) && wallet != 0 ) { if( !TDEWallet::Wallet::isOpen( TDEWallet::Wallet::NetworkWallet() ) && wallet != 0 ) {
delete wallet; delete wallet;
@ -542,7 +561,7 @@ TQString KRarcHandler::getPassword( TQString path ) {
} }
} }
} }
bool keep = true; bool keep = true;
TQString user = "archive"; TQString user = "archive";
TDEIO::PasswordDialog passDlg( i18n("This archive is encrypted, please supply the password:"), TDEIO::PasswordDialog passDlg( i18n("This archive is encrypted, please supply the password:"),
@ -572,7 +591,7 @@ TQString KRarcHandler::getPassword( TQString path ) {
} }
return password; return password;
} }
return ""; return "";
} }
@ -580,7 +599,7 @@ bool KRarcHandler::isArchive(const KURL& url) {
TQString protocol = url.protocol(); TQString protocol = url.protocol();
if (arcProtocols.find(protocol) != arcProtocols.end()) if (arcProtocols.find(protocol) != arcProtocols.end())
return true; return true;
else return false; else return false;
} }
TQString KRarcHandler::getType( bool &encrypted, TQString fileName, TQString mime, bool checkEncrypted ) { TQString KRarcHandler::getType( bool &encrypted, TQString fileName, TQString mime, bool checkEncrypted ) {
@ -589,10 +608,16 @@ TQString KRarcHandler::getType( bool &encrypted, TQString fileName, TQString mim
result = mime; result = mime;
else else
result = "-" + result; result = "-" + result;
if( result.endsWith( "-7z" ) ) if (result.endsWith("-7z"))
{
result = "-7z"; result = "-7z";
}
if (result.endsWith("-xz"))
{
result = "-xz";
}
return result.right( 4 ); return result.right( 4 );
} }
@ -602,9 +627,9 @@ bool KRarcHandler::checkStatus( TQString type, int exitCode ) {
return exitCode == 0 || exitCode == 1; return exitCode == 0 || exitCode == 1;
else if( type == "-ace" || type == "zip2" || type == "-lha" || type == "-rpm" || type == "cpio" || else if( type == "-ace" || type == "zip2" || type == "-lha" || type == "-rpm" || type == "cpio" ||
type == "-tar" || type == "tarz" || type == "-tbz" || type == "-tgz" || type == "-arj" || type == "-tar" || type == "tarz" || type == "-tbz" || type == "-tgz" || type == "-arj" ||
type == "-deb" ) type == "-deb" || type == "-txz" || type == "-xz")
return exitCode == 0; return exitCode == 0;
else if( type == "gzip" ) else if (type == "gzip" || type == "-xz")
return exitCode == 0 || exitCode == 2; return exitCode == 0 || exitCode == 2;
else else
return exitCode == 0; return exitCode == 0;
@ -623,27 +648,28 @@ TQString KRarcHandler::detectArchive( bool &encrypted, TQString fileName, bool c
{"rpm", 0, "\xed\xab\xee\xdb"}, {"rpm", 0, "\xed\xab\xee\xdb"},
{"ace", 7, "**ACE**" }, {"ace", 7, "**ACE**" },
{"bzip2",0, "\x42\x5a\x68\x39\x31" }, {"bzip2",0, "\x42\x5a\x68\x39\x31" },
{"gzip", 0, "\x1f\x8b"}, {"gzip", 0, "\x1f\x8b"},
{"deb", 0, "!<arch>\ndebian-binary " }, {"deb", 0, "!<arch>\ndebian-binary " },
{"7z", 0, "7z\xbc\xaf\x27\x1c" } }; {"7z", 0, "7z\xbc\xaf\x27\x1c" },
{"xz", 0, "\xfd7zXZ\x00" } };
static int autoDetectElems = sizeof( autoDetectParams ) / sizeof( AutoDetectParams ); static int autoDetectElems = sizeof( autoDetectParams ) / sizeof( AutoDetectParams );
encrypted = false; encrypted = false;
TQFile arcFile( fileName ); TQFile arcFile( fileName );
if ( arcFile.open( IO_ReadOnly ) ) { if ( arcFile.open( IO_ReadOnly ) ) {
char buffer[ 1024 ]; char buffer[ 1024 ];
long sizeMax = arcFile.readBlock( buffer, sizeof( buffer ) ); long sizeMax = arcFile.readBlock( buffer, sizeof( buffer ) );
arcFile.close(); arcFile.close();
for( int i=0; i < autoDetectElems; i++ ) { for( int i=0; i < autoDetectElems; i++ ) {
TQString detectionString = autoDetectParams[ i ].detectionString; TQString detectionString = autoDetectParams[ i ].detectionString;
int location = autoDetectParams[ i ].location; int location = autoDetectParams[ i ].location;
int endPtr = detectionString.length() + location; int endPtr = detectionString.length() + location;
if( endPtr > sizeMax ) if( endPtr > sizeMax )
continue; continue;
unsigned int j=0; unsigned int j=0;
for(; j != detectionString.length(); j++ ) { for(; j != detectionString.length(); j++ ) {
if( detectionString[ j ] == '?' ) if( detectionString[ j ] == '?' )
@ -651,7 +677,7 @@ TQString KRarcHandler::detectArchive( bool &encrypted, TQString fileName, bool c
if( buffer[ location + j ] != detectionString[ j ] ) if( buffer[ location + j ] != detectionString[ j ] )
break; break;
} }
if( j == detectionString.length() ) { if( j == detectionString.length() ) {
TQString type = autoDetectParams[ i ].type; TQString type = autoDetectParams[ i ].type;
if( type == "bzip2" || type == "gzip" ) { if( type == "bzip2" || type == "gzip" ) {
@ -686,7 +712,7 @@ TQString KRarcHandler::detectArchive( bool &encrypted, TQString fileName, bool c
long headerSize = ((unsigned char *)buffer)[ offset+5 ] + 256*((unsigned char *)buffer)[ offset+6 ]; long headerSize = ((unsigned char *)buffer)[ offset+5 ] + 256*((unsigned char *)buffer)[ offset+6 ];
bool isDir = (buffer[ offset+7 ] == '\0' ) && (buffer[ offset+8 ] == '\0' ) && bool isDir = (buffer[ offset+7 ] == '\0' ) && (buffer[ offset+8 ] == '\0' ) &&
(buffer[ offset+9 ] == '\0' ) && (buffer[ offset+10 ] == '\0' ); (buffer[ offset+9 ] == '\0' ) && (buffer[ offset+10 ] == '\0' );
if( buffer[ offset + 2 ] != (char)0x74 ) if( buffer[ offset + 2 ] != (char)0x74 )
break; break;
if( !isDir ) { if( !isDir ) {
@ -706,7 +732,7 @@ TQString KRarcHandler::detectArchive( bool &encrypted, TQString fileName, bool c
long headerSize = ((unsigned char *)buffer)[ offset+2 ] + 256*((unsigned char *)buffer)[ offset+3 ] + 4; long headerSize = ((unsigned char *)buffer)[ offset+2 ] + 256*((unsigned char *)buffer)[ offset+3 ] + 4;
bool isDir = (buffer[ offset+11 ] == '\0' ) && (buffer[ offset+12 ] == '\0' ) && bool isDir = (buffer[ offset+11 ] == '\0' ) && (buffer[ offset+12 ] == '\0' ) &&
(buffer[ offset+13 ] == '\0' ) && (buffer[ offset+14 ] == '\0' ); (buffer[ offset+13 ] == '\0' ) && (buffer[ offset+14 ] == '\0' );
if( buffer[ offset + 4 ] != (char)0x01 ) if( buffer[ offset + 4 ] != (char)0x01 )
break; break;
if( !isDir ) { if( !isDir ) {
@ -729,7 +755,7 @@ TQString KRarcHandler::detectArchive( bool &encrypted, TQString fileName, bool c
return type; return type;
} }
} }
if( sizeMax >= 512 ) { if( sizeMax >= 512 ) {
/* checking if it's a tar file */ /* checking if it's a tar file */
unsigned checksum = 32*8; unsigned checksum = 32*8;
@ -749,6 +775,16 @@ TQString KRarcHandler::detectArchive( bool &encrypted, TQString fileName, bool c
} }
} }
} }
if (fileName.endsWith(".tar.xz"))
{
return "txz";
}
else if (fileName.endsWith(".xz"))
{
return "xz";
}
return TQString(); return TQString();
} }

@ -33,19 +33,19 @@
/////////////////////// [Startup] /////////////////////// [Startup]
// UI Save Settings // UI Save Settings
#define _UiSave false #define _UiSave false
// Show Cmd Line // Show Cmd Line
#define _ShowCmdline true #define _ShowCmdline true
// Show status bar // Show status bar
#define _ShowStatusBar true #define _ShowStatusBar true
// Show tool bar // Show tool bar
#define _ShowToolBar true #define _ShowToolBar true
// Show FN Keys // Show FN Keys
#define _ShowFNkeys true #define _ShowFNkeys true
// Show Terminal Emulator // Show Terminal Emulator
#define _ShowTerminalEmulator false #define _ShowTerminalEmulator false
// Remember Position // Remember Position
#define _RememberPos true #define _RememberPos true
// Start to tray // Start to tray
#define _StartToTray false #define _StartToTray false
// Left Tab Bar // Left Tab Bar
@ -60,21 +60,21 @@
// Filelist Font /////// // Filelist Font ///////
#define _FilelistFont new TQFont(TDEGlobalSettings::generalFont()) #define _FilelistFont new TQFont(TDEGlobalSettings::generalFont())
// Warn On Exit //////// // Warn On Exit ////////
#define _WarnOnExit false #define _WarnOnExit false
// Minimize To Tray //// // Minimize To Tray ////
#define _MinimizeToTray false #define _MinimizeToTray false
// Mark Dirs /////////// // Mark Dirs ///////////
#define _MarkDirs false #define _MarkDirs false
// Show Hidden ///////// // Show Hidden /////////
#define _ShowHidden true #define _ShowHidden true
// Sort By Extention /// // Sort By Extention ///
#define _SortByExt false #define _SortByExt false
// Case Sensative Sort / // Case Sensative Sort /
#define _CaseSensativeSort false #define _CaseSensativeSort false
// Html Min Font Size // // Html Min Font Size //
#define _HtmlMinFontSize 12 #define _HtmlMinFontSize 12
// Filelist Icon Size // // Filelist Icon Size //
#define _FilelistIconSize TQString("22") #define _FilelistIconSize TQString("22")
// Mouse Selection ///// // Mouse Selection /////
#define _MouseSelection 0 // 0 - normal (shift+click, ctrl+click), 1 - left click, 2 - right click #define _MouseSelection 0 // 0 - normal (shift+click, ctrl+click), 1 - left click, 2 - right click
// Use fullpath tab names ///// // Use fullpath tab names /////
@ -82,23 +82,23 @@
// Panel Toolbar Checkboxes // Panel Toolbar Checkboxes
// Panel Toolbar Visible checkbox turned off // Panel Toolbar Visible checkbox turned off
#define _PanelToolBar true #define _PanelToolBar true
// cd / is turned on // cd / is turned on
#define _cdRoot true #define _cdRoot true
// cd ~ is turned on // cd ~ is turned on
#define _cdHome false #define _cdHome false
// cd .. is turned on // cd .. is turned on
#define _cdUp true #define _cdUp true
// cd other panel is turned on // cd other panel is turned on
#define _cdOther false #define _cdOther false
// Open directory is turned on // Open directory is turned on
#define _Open false #define _Open false
// syncBrowseButton is turned on // syncBrowseButton is turned on
#define _syncBrowseButton false #define _syncBrowseButton false
// Clear Location Bar Visible // Clear Location Bar Visible
#define _ClearLocation true #define _ClearLocation true
// Use the default colors of KDE // Use the default colors of KDE
#define _KDEDefaultColors true #define _KDEDefaultColors true
// Enable Alternate Background colors // Enable Alternate Background colors
#define _AlternateBackground true #define _AlternateBackground true
// Show current item even if not focussed // Show current item even if not focussed
@ -124,19 +124,19 @@
/////////////////////// [General] /////////////////////// [General]
// Mimetype Magic ///// // Mimetype Magic /////
#define _MimetypeMagic true #define _MimetypeMagic true
// Move To Trash ////// // Move To Trash //////
#define _MoveToTrash false #define _MoveToTrash false
// Terminal /////////// // Terminal ///////////
#define _Terminal "konsole" #define _Terminal "konsole"
// Send CDs /////////// // Send CDs ///////////
#define _SendCDs true #define _SendCDs true
// Editor ///////////// // Editor /////////////
#define _Editor "internal editor" #define _Editor "internal editor"
// Temp Directory ///// // Temp Directory /////
#define _TempDirectory "/tmp/krusader.tmp" #define _TempDirectory "/tmp/krusader.tmp"
// Classic Quicksearch // Classic Quicksearch
#define _NewStyleQuicksearch true #define _NewStyleQuicksearch true
// Case Sensitive quick search, if _NewStyleQuicksearch is true // Case Sensitive quick search, if _NewStyleQuicksearch is true
#define _CaseSensitiveQuicksearch false #define _CaseSensitiveQuicksearch false
// View In Separate Window // View In Separate Window
@ -146,57 +146,59 @@
// Permission Check /// // Permission Check ///
//#define _PermCheck true //#define _PermCheck true
// AutoMount ////////// // AutoMount //////////
#define _AutoMount false #define _AutoMount false
// Preserving date ////////// // Preserving date //////////
#define _PreserveAttributes false #define _PreserveAttributes false
// Nonmount Points //// // Nonmount Points ////
#define _NonMountPoints "/, " #define _NonMountPoints "/, "
// Confirm Unempty Dir // (for delete) // Confirm Unempty Dir // (for delete)
#define _ConfirmUnemptyDir true #define _ConfirmUnemptyDir true
// Confirm Delete ///// (for deleting files) // Confirm Delete ///// (for deleting files)
#define _ConfirmDelete true #define _ConfirmDelete true
// Confirm Copy /////// (for copying files) // Confirm Copy /////// (for copying files)
#define _ConfirmCopy true #define _ConfirmCopy true
// Confirm Move /////// (for moving files) // Confirm Move /////// (for moving files)
#define _ConfirmMove true #define _ConfirmMove true
// Icon Cache Size //// // Icon Cache Size ////
#define _IconCacheSize 2048 #define _IconCacheSize 2048
/////////////////////// [Archives] /////////////////////// [Archives]
// Do Tar ///////////// // Do Tar /////////////
#define _DoTar true #define _DoTar true
// Do GZip //////////// // Do GZip ////////////
#define _DoGZip true #define _DoGZip true
// Do Zip ///////////// // Do Zip /////////////
#define _DoZip true #define _DoZip true
// Do UnZip /////////// // Do UnZip ///////////
#define _DoUnZip true #define _DoUnZip true
// Do BZip2 /////////// // Do BZip2 ///////////
#define _DoBZip2 true #define _DoBZip2 true
// Do Rar ///////////// // Do Rar /////////////
#define _DoRar true #define _DoRar true
// Do UnRar /////////// // Do UnRar ///////////
#define _DoUnRar true #define _DoUnRar true
// Do UnAce /////////// // Do UnAce ///////////
#define _DoUnAce true #define _DoUnAce true
// Do Arj ///////////// // Do Arj /////////////
#define _DoArj true #define _DoArj true
// Do UnArj /////////// // Do UnArj ///////////
#define _DoUnarj true #define _DoUnarj true
// Do RPM ///////////// // Do RPM /////////////
#define _DoRPM true #define _DoRPM true
// Do DEB ///////////// ====> new // Do DEB ///////////// ====> new
#define _DoDEB true #define _DoDEB true
// Do Lha ///////////// // Do Lha /////////////
#define _DoLha true #define _DoLha true
// Do 7z ///////////// ====> new // Do 7z ////////////// ====> new
#define _Do7z true #define _Do7z true
// Do Xz //////////////
#define _DoXz true
// Allow Move Into Archive // // Allow Move Into Archive //
#define _MoveIntoArchive false #define _MoveIntoArchive false
// Test Archives ////// // Test Archives //////
#define _TestArchives false #define _TestArchives false
// Test Before Unpack //// // Test Before Unpack ////
#define _TestBeforeUnpack true #define _TestBeforeUnpack true
// Supported Packers // ====> a TQStringList of SYSTEM supported archives ( also new ) // Supported Packers // ====> a TQStringList of SYSTEM supported archives ( also new )
/////////////////////// [UserActions] /////////////////////// [UserActions]
@ -211,13 +213,13 @@
/////////////////////// [Private] /////////////////////// [Private]
// Start Position ///// // Start Position /////
#define _StartPosition new TQPoint(TQApplication::desktop()->width()/2 - mainView->sizeHint().width()/2,TQApplication::desktop()->height()/2 - 250) #define _StartPosition new TQPoint(TQApplication::desktop()->width()/2 - mainView->sizeHint().width()/2,TQApplication::desktop()->height()/2 - 250)
// Start Size ///////// // Start Size /////////
#define _StartSize new TQSize(mainView->sizeHint().width(),500) #define _StartSize new TQSize(mainView->sizeHint().width(),500)
// Panel Size ///////// // Panel Size /////////
#define _PanelSize 0 #define _PanelSize 0
// Terminal Size ////// // Terminal Size //////
#define _TerminalSize 0 #define _TerminalSize 0
// Left Name Size - size of the left panel's name column // Left Name Size - size of the left panel's name column
// Left Size Size - size of the left panel's size column // Left Size Size - size of the left panel's size column
// Left Date Size - size of the left panel's date column // Left Date Size - size of the left panel's date column
@ -251,33 +253,33 @@
/////////////////////// [Synchronize directories] /////////////////////// [Synchronize directories]
// Don't overwrite automatically ///////////// // Don't overwrite automatically /////////////
#define _ConfirmOverWrites false #define _ConfirmOverWrites false
// Recursive search in the subdirectories ///////////// // Recursive search in the subdirectories /////////////
#define _RecurseSubdirs true #define _RecurseSubdirs true
// The searcher follows symlinks ///////////// // The searcher follows symlinks /////////////
#define _FollowSymlinks false #define _FollowSymlinks false
// Files with similar size are compared by content ///////////// // Files with similar size are compared by content /////////////
#define _CompareByContent false #define _CompareByContent false
// The date information is ignored at synchronization ///////////// // The date information is ignored at synchronization /////////////
#define _IgnoreDate false #define _IgnoreDate false
// Asymmetric Client-File Server compare mode ///////////// // Asymmetric Client-File Server compare mode /////////////
#define _Asymmetric false #define _Asymmetric false
// Case insensitive compare in synchronizer ///////////// // Case insensitive compare in synchronizer /////////////
#define _IgnoreCase false #define _IgnoreCase false
// Scrolls the results of the synchronization ///////////// // Scrolls the results of the synchronization /////////////
#define _ScrollResults false #define _ScrollResults false
// The right arrow button is turned on ///////////// // The right arrow button is turned on /////////////
#define _BtnLeftToRight true #define _BtnLeftToRight true
// The equals button is turned on ///////////// // The equals button is turned on /////////////
#define _BtnEquals true #define _BtnEquals true
// The not equals button is turned on ///////////// // The not equals button is turned on /////////////
#define _BtnDifferents true #define _BtnDifferents true
// The left arrow button is turned on ///////////// // The left arrow button is turned on /////////////
#define _BtnRightToLeft true #define _BtnRightToLeft true
// The trash button is turned on ///////////// // The trash button is turned on /////////////
#define _BtnDeletable true #define _BtnDeletable true
// The duplicates button is turned on ///////////// // The duplicates button is turned on /////////////
#define _BtnDuplicates true #define _BtnDuplicates true
// The singles button is turned on ///////////// // The singles button is turned on /////////////
#define _BtnSingles true #define _BtnSingles true

@ -5,10 +5,10 @@ copyright : (C) 2000 by Shie Erlich & Rafi Yanai
e-mail : krusader@users.sourceforge.net e-mail : krusader@users.sourceforge.net
web site : http://krusader.sourceforge.net web site : http://krusader.sourceforge.net
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
Description Description
*************************************************************************** ***************************************************************************
A A
db dD d8888b. db db .d8888. .d8b. d8888b. d88888b d8888b. db dD d8888b. db db .d8888. .d8b. d8888b. d88888b d8888b.
88 ,8P' 88 `8D 88 88 88' YP d8' `8b 88 `8D 88' 88 `8D 88 ,8P' 88 `8D 88 88 88' YP d8' `8b 88 `8D 88' 88 `8D
@ -28,7 +28,7 @@ YP YD 88 YD ~Y8888P' `8888Y' YP YP Y8888D' Y88888P 88 YD
* * * *
***************************************************************************/ ***************************************************************************/
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <sys/param.h> #include <sys/param.h>
#include <unistd.h> #include <unistd.h>
#ifdef BSD #ifdef BSD
@ -51,7 +51,7 @@ YP YD 88 YD ~Y8888P' `8888Y' YP YP Y8888D' Y88888P 88 YD
#include <tdeactionclasses.h> #include <tdeactionclasses.h>
#endif #endif
#include <tdeversion.h> #include <tdeversion.h>
// QT includes // QT includes
#include <tqpixmap.h> #include <tqpixmap.h>
#include <tqstringlist.h> #include <tqstringlist.h>
@ -59,7 +59,7 @@ YP YD 88 YD ~Y8888P' `8888Y' YP YP Y8888D' Y88888P 88 YD
#include <tqprinter.h> #include <tqprinter.h>
#include <tqprogressdialog.h> #include <tqprogressdialog.h>
#include <tqvaluelist.h> #include <tqvaluelist.h>
#include <tqwhatsthis.h> #include <tqwhatsthis.h>
#include <tqwidgetlist.h> #include <tqwidgetlist.h>
#include <tqdatetime.h> #include <tqdatetime.h>
#include <dcopclient.h> #include <dcopclient.h>
@ -181,7 +181,7 @@ TDERadioAction *Krusader::actSelectSingle = 0;
TDERadioAction *Krusader::actSelectNewer = 0; TDERadioAction *Krusader::actSelectNewer = 0;
TDERadioAction *Krusader::actSelectDifferentAndSingle = 0; TDERadioAction *Krusader::actSelectDifferentAndSingle = 0;
TDERadioAction *Krusader::actSelectDifferent = 0; TDERadioAction *Krusader::actSelectDifferent = 0;
TDERadioAction **Krusader::compareArray[] = {&actSelectNewerAndSingle, &actSelectNewer, &actSelectSingle, TDERadioAction **Krusader::compareArray[] = {&actSelectNewerAndSingle, &actSelectNewer, &actSelectSingle,
&actSelectDifferentAndSingle, &actSelectDifferent, 0}; &actSelectDifferentAndSingle, &actSelectDifferent, 0};
TDERadioAction *Krusader::actExecStartAndForget = 0; TDERadioAction *Krusader::actExecStartAndForget = 0;
TDERadioAction *Krusader::actExecCollectSeparate = 0; TDERadioAction *Krusader::actExecCollectSeparate = 0;
@ -278,7 +278,7 @@ Krusader::Krusader() : KParts::MainWindow(0,0,WType_TopLevel|WDestructiveClose|T
int rightActiveTab = krConfig->readNumEntry( "Right Active Tab", 0 ); int rightActiveTab = krConfig->readNumEntry( "Right Active Tab", 0 );
TQString startProfile = krConfig->readEntry("Starter Profile Name", TQString() ); TQString startProfile = krConfig->readEntry("Starter Profile Name", TQString() );
bool leftActive = krConfig->readBoolEntry( "Left Side Is Active", false ); bool leftActive = krConfig->readBoolEntry( "Left Side Is Active", false );
// get command-line arguments // get command-line arguments
if ( args->isSet( "left" ) ) { if ( args->isSet( "left" ) ) {
leftTabs = TQStringList::split( ',', args->getOption( "left" ) ); leftTabs = TQStringList::split( ',', args->getOption( "left" ) );
@ -329,8 +329,8 @@ Krusader::Krusader() : KParts::MainWindow(0,0,WType_TopLevel|WDestructiveClose|T
leftTabs.clear(); leftTabs.clear();
leftTabTypes.clear(); leftTabTypes.clear();
leftTabProps.clear(); leftTabProps.clear();
rightTabs.clear(); rightTabs.clear();
rightTabTypes.clear(); rightTabTypes.clear();
rightTabProps.clear(); rightTabProps.clear();
leftActiveTab = rightActiveTab = 0; leftActiveTab = rightActiveTab = 0;
} }
@ -349,7 +349,7 @@ Krusader::Krusader() : KParts::MainWindow(0,0,WType_TopLevel|WDestructiveClose|T
} }
// starting the panels // starting the panels
mainView->start( leftTabs, leftTabTypes, leftTabProps, leftActiveTab, rightTabs, mainView->start( leftTabs, leftTabTypes, leftTabProps, leftActiveTab, rightTabs,
rightTabTypes, rightTabProps, rightActiveTab, leftActive ); rightTabTypes, rightTabProps, rightActiveTab, leftActive );
// create the user menu // create the user menu
@ -397,7 +397,7 @@ Krusader::Krusader() : KParts::MainWindow(0,0,WType_TopLevel|WDestructiveClose|T
if ( runKonfig ) if ( runKonfig )
slot->runKonfigurator( true ); slot->runKonfigurator( true );
if (!runKonfig) { if (!runKonfig) {
config->setGroup( "Private" ); config->setGroup( "Private" );
if ( krConfig->readBoolEntry( "Maximized" ) ) if ( krConfig->readBoolEntry( "Maximized" ) )
@ -407,7 +407,7 @@ Krusader::Krusader() : KParts::MainWindow(0,0,WType_TopLevel|WDestructiveClose|T
resize( oldSize = krConfig->readSizeEntry( "Start Size", _StartSize )); resize( oldSize = krConfig->readSizeEntry( "Start Size", _StartSize ));
} }
} }
if( startToTray ) { if( startToTray ) {
sysTray->show(); sysTray->show();
hide(); hide();
@ -436,7 +436,7 @@ bool Krusader::versionControl() {
config = kapp->config(); config = kapp->config();
bool firstRun = config->readBoolEntry(FIRST_RUN, true); bool firstRun = config->readBoolEntry(FIRST_RUN, true);
#if 0 #if 0
TQString oldVerText = config->readEntry( "Version", "10.0" ); TQString oldVerText = config->readEntry( "Version", "10.0" );
oldVerText.truncate( oldVerText.findRev( "." ) ); // remove the third dot oldVerText.truncate( oldVerText.findRev( "." ) ); // remove the third dot
float oldVer = oldVerText.toFloat(); float oldVer = oldVerText.toFloat();
@ -459,13 +459,28 @@ bool Krusader::versionControl() {
} }
config->writeEntry( "Version", VERSION ); config->writeEntry( "Version", VERSION );
config->writeEntry( FIRST_RUN, false); config->writeEntry( FIRST_RUN, false);
// Check whether Krusader is run for the first time under a new TDE version.
TQString lastVersion = config->readEntry("Last version");
if (lastVersion != TDE_VERSION_STRING)
{
config->writeEntry("Last version", TDE_VERSION_STRING);
if (!retval)
{
KMessageBox::information(krApp, i18n( "<qt><b>Welcome to Krusader!</b><p>As this is your first run "
"under TDE " TDE_VERSION_STRING ", your machine will now be checked for external applications updates. "
"Then the Konfigurator will be launched where you can customize Krusader to your needs.</p></qt>" ) );
}
retval = true;
}
config->sync(); config->sync();
return retval; return retval;
} }
void Krusader::statusBarUpdate( TQString& mess ) { void Krusader::statusBarUpdate( TQString& mess ) {
// change the message on the statusbar for 2 seconds // change the message on the statusbar for 2 seconds
if (status) // ugly!!!! But as statusBar() creates a status bar if there is no, I have to ask status to prevent if (status) // ugly!!!! But as statusBar() creates a status bar if there is no, I have to ask status to prevent
// the creation of the TDE default status bar instead of KrusaderStatus. // the creation of the TDE default status bar instead of KrusaderStatus.
statusBar() ->message( mess, 5000 ); statusBar() ->message( mess, 5000 );
} }
@ -476,7 +491,7 @@ void Krusader::showEvent ( TQShowEvent * ) {
config->setGroup( "Look&Feel" ); config->setGroup( "Look&Feel" );
bool showTrayIcon = krConfig->readBoolEntry( "Minimize To Tray", _MinimizeToTray ); bool showTrayIcon = krConfig->readBoolEntry( "Minimize To Tray", _MinimizeToTray );
bool singleInstanceMode = krConfig->readBoolEntry( "Single Instance Mode", _SingleInstanceMode ); bool singleInstanceMode = krConfig->readBoolEntry( "Single Instance Mode", _SingleInstanceMode );
if( showTrayIcon && !singleInstanceMode ) if( showTrayIcon && !singleInstanceMode )
sysTray->hide(); sysTray->hide();
show(); // needed to make sure krusader is removed from show(); // needed to make sure krusader is removed from
@ -706,7 +721,7 @@ void Krusader::setupActions() {
actRoot = new TDEAction( i18n( "Root" ), "go-top", CTRL + Key_Backspace, actRoot = new TDEAction( i18n( "Root" ), "go-top", CTRL + Key_Backspace,
SLOTS, TQT_SLOT( root() ), actionCollection(), "root" ); SLOTS, TQT_SLOT( root() ), actionCollection(), "root" );
actSavePosition = new TDEAction( i18n( "Save &Position" ), 0, actSavePosition = new TDEAction( i18n( "Save &Position" ), 0,
TQT_TQOBJECT(krApp), TQT_SLOT( savePosition() ), actionCollection(), "save position" ); TQT_TQOBJECT(krApp), TQT_SLOT( savePosition() ), actionCollection(), "save position" );
actAllFilter = new TDEAction( i18n( "&All Files" ), SHIFT + Key_F10, actAllFilter = new TDEAction( i18n( "&All Files" ), SHIFT + Key_F10,
SLOTS, TQT_SLOT( allFilter() ), actionCollection(), "all files" ); SLOTS, TQT_SLOT( allFilter() ), actionCollection(), "all files" );
//actExecFilter = new TDEAction( i18n( "&Executables" ), SHIFT + Key_F11, //actExecFilter = new TDEAction( i18n( "&Executables" ), SHIFT + Key_F11,
@ -745,7 +760,7 @@ void Krusader::setupActions() {
SLOTS, TQT_SLOT( newSymlink() ), actionCollection(), "new symlink"); SLOTS, TQT_SLOT( newSymlink() ), actionCollection(), "new symlink");
new TDEToggleAction( i18n( "Toggle Popup Panel" ), ALT + Key_Down, SLOTS, new TDEToggleAction( i18n( "Toggle Popup Panel" ), ALT + Key_Down, SLOTS,
TQT_SLOT( togglePopupPanel() ), actionCollection(), "toggle popup panel" ); TQT_SLOT( togglePopupPanel() ), actionCollection(), "toggle popup panel" );
actVerticalMode = new TDEToggleAction( i18n( "Vertical Mode" ), "view_top_bottom", ALT + CTRL + Key_R, TQT_TQOBJECT(MAIN_VIEW), actVerticalMode = new TDEToggleAction( i18n( "Vertical Mode" ), "view_top_bottom", ALT + CTRL + Key_R, TQT_TQOBJECT(MAIN_VIEW),
TQT_SLOT( toggleVerticalMode() ), actionCollection(), "toggle vertical mode" ); TQT_SLOT( toggleVerticalMode() ), actionCollection(), "toggle vertical mode" );
actNewTab = new TDEAction( i18n( "New Tab" ), "tab_new", ALT + CTRL + Key_N, SLOTS, actNewTab = new TDEAction( i18n( "New Tab" ), "tab_new", ALT + CTRL + Key_N, SLOTS,
TQT_SLOT( newTab() ), actionCollection(), "new tab" ); TQT_SLOT( newTab() ), actionCollection(), "new tab" );
@ -833,11 +848,11 @@ void Krusader::savePosition() {
mainView->right->popup->saveSizes(); mainView->right->popup->saveSizes();
if( !MAIN_VIEW->getTerminalEmulatorSplitterSizes().isEmpty() ) if( !MAIN_VIEW->getTerminalEmulatorSplitterSizes().isEmpty() )
config->writeEntry( "Terminal Emulator Splitter Sizes", MAIN_VIEW->getTerminalEmulatorSplitterSizes() ); config->writeEntry( "Terminal Emulator Splitter Sizes", MAIN_VIEW->getTerminalEmulatorSplitterSizes() );
// save view settings ---> fix when we have tabbed-browsing // save view settings ---> fix when we have tabbed-browsing
mainView->left->view->saveSettings(); mainView->left->view->saveSettings();
mainView->right->view->saveSettings(); mainView->right->view->saveSettings();
config->setGroup( "Startup" ); config->setGroup( "Startup" );
config->writeEntry( "Vertical Mode", actVerticalMode->isChecked()); config->writeEntry( "Vertical Mode", actVerticalMode->isChecked());
config->sync(); config->sync();
@ -846,13 +861,13 @@ void Krusader::savePosition() {
void Krusader::saveSettings() { void Krusader::saveSettings() {
toolBar() ->saveSettings( krConfig, "Private" ); toolBar() ->saveSettings( krConfig, "Private" );
toolBar("actionsToolBar")->saveSettings( krConfig, "Actions Toolbar" ); toolBar("actionsToolBar")->saveSettings( krConfig, "Actions Toolbar" );
config->setGroup( "Startup" ); config->setGroup( "Startup" );
config->writeEntry( "Left Active Tab", mainView->leftMng->activeTab() ); config->writeEntry( "Left Active Tab", mainView->leftMng->activeTab() );
config->writeEntry( "Right Active Tab", mainView->rightMng->activeTab() ); config->writeEntry( "Right Active Tab", mainView->rightMng->activeTab() );
config->writeEntry( "Left Side Is Active", MAIN_VIEW->activePanel->isLeft() ); config->writeEntry( "Left Side Is Active", MAIN_VIEW->activePanel->isLeft() );
mainView->leftMng->saveSettings( krConfig, "Left Tab Bar" ); mainView->leftMng->saveSettings( krConfig, "Left Tab Bar" );
mainView->rightMng->saveSettings( krConfig, "Right Tab Bar" ); mainView->rightMng->saveSettings( krConfig, "Right Tab Bar" );
bool rememberpos = config->readBoolEntry( "Remember Position", _RememberPos ); bool rememberpos = config->readBoolEntry( "Remember Position", _RememberPos );
bool uisavesettings = config->readBoolEntry( "UI Save Settings", _UiSave ); bool uisavesettings = config->readBoolEntry( "UI Save Settings", _UiSave );
@ -898,7 +913,7 @@ void Krusader::configChanged() {
config->setGroup( "Look&Feel" ); config->setGroup( "Look&Feel" );
bool minimizeToTray = config->readBoolEntry( "Minimize To Tray", _MinimizeToTray ); bool minimizeToTray = config->readBoolEntry( "Minimize To Tray", _MinimizeToTray );
bool singleInstanceMode = config->readBoolEntry( "Single Instance Mode", _SingleInstanceMode ); bool singleInstanceMode = config->readBoolEntry( "Single Instance Mode", _SingleInstanceMode );
if( !isHidden() ) { if( !isHidden() ) {
if( singleInstanceMode && minimizeToTray ) if( singleInstanceMode && minimizeToTray )
sysTray->show(); sysTray->show();
@ -918,9 +933,9 @@ void Krusader::slotClose() {
bool Krusader::queryClose() { bool Krusader::queryClose() {
if( isStarting || isExiting ) if( isStarting || isExiting )
return false; return false;
if( kapp->sessionSaving() ) // KDE is logging out, accept the close if( kapp->sessionSaving() ) // KDE is logging out, accept the close
{ {
saveSettings(); saveSettings();
kapp->dcopClient()->registerAs( TDEApplication::kApplication()->name(), true ); kapp->dcopClient()->registerAs( TDEApplication::kApplication()->name(), true );
@ -929,9 +944,9 @@ bool Krusader::queryClose() {
kapp->deref(); // and close the application kapp->deref(); // and close the application
return isExiting = true; // this will also kill the pending jobs return isExiting = true; // this will also kill the pending jobs
} }
krConfig->setGroup( "Look&Feel" ); krConfig->setGroup( "Look&Feel" );
if( !directExit && krConfig->readBoolEntry( "Single Instance Mode", _SingleInstanceMode ) && if( !directExit && krConfig->readBoolEntry( "Single Instance Mode", _SingleInstanceMode ) &&
krConfig->readBoolEntry( "Minimize To Tray", _MinimizeToTray ) ) { krConfig->readBoolEntry( "Minimize To Tray", _MinimizeToTray ) ) {
hide(); hide();
return false; return false;
@ -942,7 +957,7 @@ bool Krusader::queryClose() {
directExit = false; directExit = false;
bool quit = true; bool quit = true;
if ( krConfig->readBoolEntry( "Warn On Exit", _WarnOnExit ) ) { if ( krConfig->readBoolEntry( "Warn On Exit", _WarnOnExit ) ) {
switch ( KMessageBox::warningYesNo( this, switch ( KMessageBox::warningYesNo( this,
i18n( "Are you sure you want to quit?" ) ) ) { i18n( "Are you sure you want to quit?" ) ) ) {
@ -989,11 +1004,11 @@ bool Krusader::queryClose() {
if( w->inherits( TQDIALOG_OBJECT_NAME_STRING ) ) if( w->inherits( TQDIALOG_OBJECT_NAME_STRING ) )
fprintf( stderr, "Failed to close: %s\n", w->className() ); fprintf( stderr, "Failed to close: %s\n", w->className() );
return false; return false;
} }
} }
saveSettings(); saveSettings();
isExiting = true; isExiting = true;
@ -1016,8 +1031,8 @@ void Krusader::startWaiting( TQString msg, int count , bool cancel ) {
plzWait->startWaiting( msg , count, cancel ); plzWait->startWaiting( msg , count, cancel );
} }
bool Krusader::wasWaitingCancelled() const { bool Krusader::wasWaitingCancelled() const {
return plzWait->wasCancelled(); return plzWait->wasCancelled();
} }
void Krusader::incProgress( TDEProcess *, char *buffer, int buflen ) { void Krusader::incProgress( TDEProcess *, char *buffer, int buflen ) {
@ -1039,18 +1054,18 @@ void Krusader::updateGUI( bool enforce ) {
// call the XML GUI function to draw the UI // call the XML GUI function to draw the UI
createGUI( mainView->konsole_part ); createGUI( mainView->konsole_part );
// this needs to be called AFTER createGUI() !!! // this needs to be called AFTER createGUI() !!!
userActionMenu = (TDEPopupMenu*) guiFactory()->container( "useractionmenu", this ); userActionMenu = (TDEPopupMenu*) guiFactory()->container( "useractionmenu", this );
if ( userActionMenu ) if ( userActionMenu )
userAction->populateMenu( userActionMenu ); userAction->populateMenu( userActionMenu );
toolBar() ->applySettings( krConfig, "Private" ); toolBar() ->applySettings( krConfig, "Private" );
toolBar("actionsToolBar") ->applySettings( krConfig, "Actions Toolbar" ); toolBar("actionsToolBar") ->applySettings( krConfig, "Actions Toolbar" );
static_cast<TDEToggleAction*>(actionCollection()->action("toggle actions toolbar"))-> static_cast<TDEToggleAction*>(actionCollection()->action("toggle actions toolbar"))->
setChecked(toolBar("actionsToolBar")->isVisible()); setChecked(toolBar("actionsToolBar")->isVisible());
if ( enforce ) { if ( enforce ) {
// now, hide what need to be hidden // now, hide what need to be hidden
if ( !krConfig->readBoolEntry( "Show tool bar", _ShowToolBar ) ) { if ( !krConfig->readBoolEntry( "Show tool bar", _ShowToolBar ) ) {

Loading…
Cancel
Save