summaryrefslogtreecommitdiffstats
path: root/kio/kfile
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-09-02 21:21:15 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-09-02 21:21:15 +0000
commit96900dbce3aaa1fcac74a07a71482c5c6fcd3cab (patch)
treebf3fc68d0dcc660fce0e21171373a2d4e2395707 /kio/kfile
parent5f99bff82d3413803bcc652999f4f631058179d6 (diff)
downloadtdelibs-96900dbce3aaa1fcac74a07a71482c5c6fcd3cab.tar.gz
tdelibs-96900dbce3aaa1fcac74a07a71482c5c6fcd3cab.zip
* Large set of SuSE patches to fix bugs and add functionality
* kdemm is included but not used by knotify as it does not work out of the box git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdelibs@1171141 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kio/kfile')
-rw-r--r--kio/kfile/kfiledialog.cpp6
-rw-r--r--kio/kfile/kfilesharedlg.cpp59
-rw-r--r--kio/kfile/kfilesharedlg.h3
-rw-r--r--kio/kfile/kurlbar.cpp13
4 files changed, 70 insertions, 11 deletions
diff --git a/kio/kfile/kfiledialog.cpp b/kio/kfile/kfiledialog.cpp
index f206a4887..0c9364943 100644
--- a/kio/kfile/kfiledialog.cpp
+++ b/kio/kfile/kfiledialog.cpp
@@ -1165,6 +1165,12 @@ void KFileDialog::urlEntered(const KURL& url)
d->pathCombo->setURL( url );
}
+ if (url.protocol()=="beagle" && url.path()=="/") {
+ d->pathCombo->setEditText("beagle:/<"+i18n("search term")+">");
+ d->pathCombo->lineEdit()->setSelection(8,255);
+ d->pathCombo->setFocus();
+ }
+
locationEdit->blockSignals( true );
locationEdit->setCurrentItem( 0 );
if ( d->keepLocation )
diff --git a/kio/kfile/kfilesharedlg.cpp b/kio/kfile/kfilesharedlg.cpp
index 788edee51..329bd19dc 100644
--- a/kio/kfile/kfilesharedlg.cpp
+++ b/kio/kfile/kfilesharedlg.cpp
@@ -24,6 +24,7 @@
#include <tqradiobutton.h>
#include <tqbuttongroup.h>
#include <tqlayout.h>
+#include <tqlineedit.h>
#include <kprocess.h>
#include <kprocio.h>
#include <klocale.h>
@@ -47,6 +48,7 @@ public:
KProcess *m_configProc;
bool m_bAllShared;
bool m_bAllUnshared;
+ bool m_bAllReadOnly;
};
KFileSharePropsPlugin::KFileSharePropsPlugin( KPropertiesDialog *_props )
@@ -98,8 +100,10 @@ void KFileSharePropsPlugin::init()
delete m_widget;
m_rbShare = 0L;
m_rbUnShare = 0L;
+ m_rbSharerw = 0L;
m_widget = new TQWidget( d->m_vBox );
TQVBoxLayout * vbox = new TQVBoxLayout( m_widget );
+ //TQHBoxLayout * hbox = new TQHBoxLayout( vbox );
switch ( KFileShare::authorization() ) {
case KFileShare::Authorized:
@@ -110,18 +114,29 @@ void KFileSharePropsPlugin::init()
home += '/';
bool ok = true;
KFileItemList items = properties->items();
- // We have 3 possibilities: all shared, all unshared, or mixed.
+ // We have 3 possibilities: all shared, all unshared (ro,rw), or mixed.
d->m_bAllShared = true;
d->m_bAllUnshared = true;
+ d->m_bAllReadOnly = true;
KFileItemListIterator it( items );
for ( ; it.current() && ok; ++it ) {
TQString path = (*it)->url().path();
+ // 0 => not shared
+ // 1 => shared read only
+ // 3 => shared writeable
+ int dirStatus = KFileShare::isDirectoryShared( path );
if ( !path.startsWith( home ) )
ok = false;
- if ( KFileShare::isDirectoryShared( path ) )
+ if ( dirStatus == 1 ) {
d->m_bAllUnshared = false;
- else
- d->m_bAllShared = false;
+ }
+ else if ( dirStatus == 3 ) {
+ d->m_bAllUnshared = false;
+ d->m_bAllReadOnly = false;
+ }
+ else {
+ d->m_bAllReadOnly = false;
+ }
}
if ( !ok )
{
@@ -141,16 +156,31 @@ void KFileSharePropsPlugin::init()
vbox->addWidget( m_rbUnShare, 0 );
rbGroup->insert( m_rbUnShare );
- m_rbShare = new TQRadioButton( i18n("Shared"), m_widget );
+ m_rbShare = new TQRadioButton( i18n("Shared - read only for others"), m_widget );
connect( m_rbShare, TQT_SIGNAL( toggled(bool) ), TQT_SIGNAL( changed() ) );
vbox->addWidget( m_rbShare, 0 );
rbGroup->insert( m_rbShare );
+ m_rbSharerw = new TQRadioButton( i18n("Shared - writeable for others"), m_widget );
+ connect( m_rbSharerw, TQT_SIGNAL( toggled(bool) ), TQT_SIGNAL( changed() ) );
+ vbox->addWidget( m_rbSharerw, 0 );
+ rbGroup->insert( m_rbSharerw );
+
+ //TQLabel *testlabel1 = new TQLabel(i18n("Enter Samba Share Name here"),m_widget);
+ //m_leSmbShareName = new TQLineEdit(m_widget);
+ //m_leSmbShareName->setMaxLength(12);
+
+ //hbox->addWidget( testlabel1, 0 );
+ //hbox->addWidget( m_leSmbShareName );
+ //vbox->addLayout( hbox );
+
// Activate depending on status
if ( d->m_bAllShared )
- m_rbShare->setChecked(true);
+ m_rbSharerw->setChecked(true);
if ( d->m_bAllUnshared )
m_rbUnShare->setChecked(true);
+ if ( d->m_bAllReadOnly )
+ m_rbShare->setChecked(true);
// Some help text
TQLabel *label = new TQLabel( i18n("Sharing this folder makes it available under Linux/UNIX (NFS) and Windows (Samba).") , m_widget );
@@ -167,6 +197,9 @@ void KFileSharePropsPlugin::init()
vbox->addWidget( m_pbConfig, 0, Qt::AlignHCenter );
vbox->addStretch( 10 );
+
+ if( !KFileShare::sambaActive() && !KFileShare::nfsActive())
+ m_widget->setEnabled( false );
}
}
break;
@@ -228,7 +261,7 @@ void KFileSharePropsPlugin::slotConfigureFileSharingDone()
void KFileSharePropsPlugin::applyChanges()
{
kdDebug() << "KFileSharePropsPlugin::applyChanges" << endl;
- if ( m_rbShare && m_rbUnShare )
+ if ( m_rbShare && m_rbUnShare && m_rbSharerw )
{
bool share = m_rbShare->isChecked();
@@ -242,7 +275,7 @@ void KFileSharePropsPlugin::applyChanges()
bool ok = true;
for ( ; it.current() && ok; ++it ) {
TQString path = (*it)->url().path();
- ok = setShared( path, share );
+ ok = SuSEsetShared( path, share, m_rbSharerw->isChecked() );
if (!ok) {
if (share)
KMessageBox::detailedError(properties,
@@ -269,8 +302,14 @@ void KFileSharePropsPlugin::applyChanges()
bool KFileSharePropsPlugin::setShared( const TQString& path, bool shared )
{
- kdDebug() << "KFileSharePropsPlugin::setShared " << path << "," << shared << endl;
- return KFileShare::setShared( path, shared );
+ return SuSEsetShared( path, shared, true );
+}
+
+bool KFileSharePropsPlugin::SuSEsetShared( const TQString& path, bool shared, bool readonly )
+{
+ kdDebug() << "KFileSharePropsPlugin::setShared " << path << ","
+ << shared << readonly << endl;
+ return KFileShare::SuSEsetShared( path, shared, readonly );
}
TQWidget* KFileSharePropsPlugin::page() const
diff --git a/kio/kfile/kfilesharedlg.h b/kio/kfile/kfilesharedlg.h
index 25fbc7f67..54876f12a 100644
--- a/kio/kfile/kfilesharedlg.h
+++ b/kio/kfile/kfilesharedlg.h
@@ -55,10 +55,13 @@ protected slots:
private:
void init();
bool setShared( const TQString&path, bool shared );
+ bool SuSEsetShared( const TQString&path, bool shared, bool readonly );
TQWidget *m_widget;
TQRadioButton *m_rbShare;
+ TQRadioButton *m_rbSharerw;
TQRadioButton *m_rbUnShare;
+ //TQLineEdit *m_leSmbShareName;
TQPushButton *m_pbConfig;
class Private;
Private *d;
diff --git a/kio/kfile/kurlbar.cpp b/kio/kfile/kurlbar.cpp
index 5c2b167c0..08dd36656 100644
--- a/kio/kfile/kurlbar.cpp
+++ b/kio/kfile/kurlbar.cpp
@@ -605,8 +605,19 @@ void KURLBar::readItem( int i, KConfig *config, bool applicationLocal )
if ( !url.isValid() || !KProtocolInfo::isKnownProtocol( url ))
return; // nothing we could do.
+ TQString description = config->readEntry( TQString("Description_") + number );
+
+ if (description.isEmpty() && url.protocol()=="beagle") {
+ KIO::UDSEntry uds;
+ const KURL kurl("beagle:?beagled-status");
+ if (!KIO::NetAccess::stat(kurl, uds))
+ return;
+
+ description = i18n("Desktop Search");
+ }
+
insertItem( url,
- config->readEntry( TQString("Description_") + number ),
+ description,
applicationLocal,
config->readEntry( TQString("Icon_") + number ),
static_cast<KIcon::Group>(