summaryrefslogtreecommitdiffabout
path: root/microkde/kio
Side-by-side diff
Diffstat (limited to 'microkde/kio') (more/less context) (ignore whitespace changes)
-rw-r--r--microkde/kio/kfile/kurlrequester.cpp10
-rw-r--r--microkde/kio/kfile/kurlrequester.h4
-rw-r--r--microkde/kio/kio/kdirwatch.cpp12
-rw-r--r--microkde/kio/kio/kdirwatch_p.h10
4 files changed, 20 insertions, 16 deletions
diff --git a/microkde/kio/kfile/kurlrequester.cpp b/microkde/kio/kfile/kurlrequester.cpp
index ca94570..ce62da7 100644
--- a/microkde/kio/kfile/kurlrequester.cpp
+++ b/microkde/kio/kfile/kurlrequester.cpp
@@ -14,32 +14,34 @@
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#include <sys/stat.h>
#ifdef _WIN32_
#else
#include <unistd.h>
#endif
#include <qstring.h>
//US #include <qtooltip.h>
#include <qpushbutton.h>
+//Added by qt3to4:
+#include <QPixmap>
//US #include <kaccel.h>
//US #include <kcombobox.h>
#include <kdebug.h>
#include <kdialog.h>
#include <kfiledialog.h>
#include <kglobal.h>
#include <kiconloader.h>
#include <klineedit.h>
#include <klocale.h>
//US #include <kurlcompletion.h>
//US #include <kurldrag.h>
//US #include <kprotocolinfo.h>
#include "kurlrequester.h"
@@ -169,68 +171,68 @@ KURLRequester::KURLRequester( QWidget *editWidget, QWidget *parent,
const char *name )
: QHBox( parent, name )
{
d = new KURLRequesterPrivate;
// must have this as parent
editWidget->reparent( this, 0, QPoint(0,0) );
//US d->edit = dynamic_cast<KLineEdit*>( editWidget );
d->edit = (KLineEdit*)( editWidget );
//US d->combo = dynamic_cast<KComboBox*>( editWidget );
init();
}
*/
KURLRequester::KURLRequester( QWidget *parent, const char *name )
- : QHBox( parent, name )
+ : Q3HBox( parent, name )
{
d = new KURLRequesterPrivate;
init();
}
KURLRequester::KURLRequester( const QString& url, QWidget *parent,
const char *name )
- : QHBox( parent, name )
+ : Q3HBox( parent, name )
{
d = new KURLRequesterPrivate;
init();
setURL( url );
}
KURLRequester::~KURLRequester()
{
//US delete myCompletion;
delete myFileDialog;
delete d;
}
void KURLRequester::init()
{
myFileDialog = 0L;
myShowLocalProt = false;
mPathIsDir = false;
if (/*US !d->combo && */ !d->edit )
d->edit = new KLineEdit( this, "KURLRequester::KLineEdit" );
myButton = new KURLDragPushButton( this, "kfile button");
- QIconSet iconSet = SmallIconSet("fileopen");
- QPixmap pixMap = iconSet.pixmap( QIconSet::Small, QIconSet::Normal );
+ QIcon iconSet = SmallIconSet("fileopen");
+ QPixmap pixMap = iconSet.pixmap( QIcon::Small, QIcon::Normal );
myButton->setIconSet( iconSet );
myButton->setFixedSize( pixMap.width()+8, pixMap.height()+8 );
//US QToolTip::add(myButton, i18n("Open file dialog"));
connect( myButton, SIGNAL( pressed() ), SLOT( slotUpdateURL() ));
setSpacing( KDialog::spacingHint() );
QWidget *widget = /*US d->combo ? (QWidget*) d->combo : */ (QWidget*) d->edit;
setFocusProxy( widget );
d->connectSignals( this );
connect( myButton, SIGNAL( clicked() ), this, SLOT( slotOpenDialog() ));
/*US
myCompletion = new KURLCompletion();
d->setCompletionObject( myCompletion );
diff --git a/microkde/kio/kfile/kurlrequester.h b/microkde/kio/kfile/kurlrequester.h
index faa3326..5d4fa11 100644
--- a/microkde/kio/kfile/kurlrequester.h
+++ b/microkde/kio/kfile/kurlrequester.h
@@ -7,66 +7,66 @@
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#ifndef KURLREQUESTER_H
#define KURLREQUESTER_H
-#include <qhbox.h>
+#include <q3hbox.h>
#include <keditlistbox.h>
//US #include <kfile.h>
//US #include <kpushbutton.h>
#include <kurl.h>
//US class KComboBox;
class KFileDialog;
class KLineEdit;
//US class KURLCompletion;
class KURLDragPushButton;
class QPushButton;
class QString;
class QTimer;
/**
* This class is a widget showing a lineedit and a button, which invokes a
* filedialog. File name completion is available in the lineedit.
*
* The defaults for the filedialog are to ask for one existing local file, i.e.
* KFileDialog::setMode( KFile::File | KFile::ExistingOnly | KFile::LocalOnly )
* The default filter is "*", i.e. show all files, and the start directory is
* the current working directory, or the last directory where a file has been
* selected.
*
* You can change this behavior by using @ref setMode() or @ref setFilter().
*
* @short A widget to request a filename/url from the user
* @author Carsten Pfeiffer <pfeiffer@kde.org>
*/
-class KURLRequester : public QHBox
+class KURLRequester : public Q3HBox
{
Q_OBJECT
Q_PROPERTY( QString url READ url WRITE setURL )
public:
/**
* Constructs a KURLRequester widget.
*/
KURLRequester( QWidget *parent=0, const char *name=0 );
/**
* Constructs a KURLRequester widget with the initial URL @p url.
*/
KURLRequester( const QString& url, QWidget *parent=0, const char *name=0 );
/**
diff --git a/microkde/kio/kio/kdirwatch.cpp b/microkde/kio/kio/kdirwatch.cpp
index 1596d1f..5f07c54 100644
--- a/microkde/kio/kio/kdirwatch.cpp
+++ b/microkde/kio/kio/kdirwatch.cpp
@@ -39,37 +39,39 @@ $Id$
//US #include <config.h>
#ifdef HAVE_DNOTIFY
#include <unistd.h>
#include <time.h>
#include <fcntl.h>
#include <signal.h>
#include <errno.h>
#endif
#include <sys/stat.h>
#include <assert.h>
#include <qdir.h>
#include <qfile.h>
-#include <qintdict.h>
-#include <qptrlist.h>
+#include <q3intdict.h>
+#include <q3ptrlist.h>
#include <qsocketnotifier.h>
#include <qstringlist.h>
#include <qtimer.h>
+//Added by qt3to4:
+#include <Q3CString>
#include <kapplication.h>
#include <kdebug.h>
#include <kconfig.h>
#include <kconfigbase.h>
#include <kglobal.h>
#include <kstaticdeleter.h>
#include "kdirwatch.h"
#include "kdirwatch_p.h"
//US #include "global.h" // KIO::probably_slow_mounted
#define NO_NOTIFY (time_t) 0
static KDirWatchPrivate* dwp_self = 0;
@@ -171,33 +173,33 @@ void KDirWatchPrivate::dnotify_sigio_handler(int sig, siginfo_t *si, void *p)
* is changed.
*/
KDirWatchPrivate::KDirWatchPrivate()
{
timer = new QTimer(this);
connect (timer, SIGNAL(timeout()), this, SLOT(slotRescan()));
freq = 3600000; // 1 hour as upper bound
statEntries = 0;
delayRemove = false;
m_ref = 0;
//US KConfigGroup config(KGlobal::config(), QCString("DirWatch"));
//US m_nfsPollInterval = config.readNumEntry("NFSPollInterval", 5000);
//US m_PollInterval = config.readNumEntry("PollInterval", 500);
KConfig *config = KGlobal::config();
- KConfigGroupSaver saver( config, QCString("DirWatch") );
+ KConfigGroupSaver saver( config, Q3CString("DirWatch") );
m_nfsPollInterval = config->readNumEntry("NFSPollInterval", 5000);
m_PollInterval = config->readNumEntry("PollInterval", 500);
QString available("Stat");
#ifdef HAVE_FAM
// It's possible that FAM server can't be started
if (FAMOpen(&fc) ==0) {
available += ", FAM";
use_fam=true;
sn = new QSocketNotifier( FAMCONNECTION_GETFD(&fc),
QSocketNotifier::Read, this);
connect( sn, SIGNAL(activated(int)),
this, SLOT(famEventReceived()) );
@@ -718,33 +720,33 @@ void KDirWatchPrivate::removeEntry( KDirWatch* instance,
}
}
kdDebug(7001) << "Removed " << (e->isDir ? "Dir ":"File ") << e->path
<< (sub_entry ? QString(" for %1").arg(sub_entry->path) : QString(""))
<< (instance ? QString(" [%1]").arg(instance->name()) : QString(""))
<< endl;
m_mapEntries.remove( e->path ); // <e> not valid any more
}
/* Called from KDirWatch destructor:
* remove <instance> as client from all entries
*/
void KDirWatchPrivate::removeEntries( KDirWatch* instance )
{
- QPtrList<Entry> list;
+ Q3PtrList<Entry> list;
int minfreq = 3600000;
// put all entries where instance is a client in list
EntryMap::Iterator it = m_mapEntries.begin();
for( ; it != m_mapEntries.end(); ++it ) {
Client* c = (*it).m_clients.first();
for(;c;c=(*it).m_clients.next())
if (c->instance == instance) break;
if (c) {
c->count = 1; // forces deletion of instance as client
list.append(&(*it));
}
else if ( (*it).m_mode == StatMode && (*it).freq < minfreq )
minfreq = (*it).freq;
}
@@ -994,33 +996,33 @@ void KDirWatchPrivate::slotRemoveDelayed()
void KDirWatchPrivate::slotRescan()
{
EntryMap::Iterator it;
// People can do very long things in the slot connected to dirty(),
// like showing a message box. We don't want to keep polling during
// that time, otherwise the value of 'delayRemove' will be reset.
bool timerRunning = timer->isActive();
if ( timerRunning )
timer->stop();
// We delay deletions of entries this way.
// removeDir(), when called in slotDirty(), can cause a crash otherwise
delayRemove = true;
#ifdef HAVE_DNOTIFY
- QPtrList<Entry> dList, cList;
+ Q3PtrList<Entry> dList, cList;
// for DNotify method,
if (rescan_all)
{
// mark all as dirty
it = m_mapEntries.begin();
for( ; it != m_mapEntries.end(); ++it )
(*it).dn_dirty = true;
rescan_all = false;
}
else
{
// progate dirty flag to dependant entries (e.g. file watches)
it = m_mapEntries.begin();
for( ; it != m_mapEntries.end(); ++it )
if ( ((*it).m_mode == DNotifyMode) && (*it).dn_dirty )
diff --git a/microkde/kio/kio/kdirwatch_p.h b/microkde/kio/kio/kdirwatch_p.h
index 0ab482f..be74f2a 100644
--- a/microkde/kio/kio/kdirwatch_p.h
+++ b/microkde/kio/kio/kdirwatch_p.h
@@ -5,33 +5,33 @@
*/
/*
Enhanced Version of the file for platform independent KDE tools.
Copyright (c) 2004 Ulf Schenk
$Id$
*/
#ifndef _KDIRWATCH_P_H
#define _KDIRWATCH_P_H
#ifdef HAVE_FAM
#include <fam.h>
#endif
-#include <qptrlist.h>
+#include <q3ptrlist.h>
#include <kdirwatch.h>
#include <ctime>
#define invalid_ctime ((time_t)-1)
/* KDirWatchPrivate is a singleton and does the watching
* for every KDirWatch instance in the application.
*/
class KDirWatchPrivate : public QObject
{
Q_OBJECT
public:
enum entryStatus { Normal = 0, NonExistent };
@@ -45,35 +45,35 @@ public:
bool watchingStopped;
// events blocked when stopped
int pending;
};
class Entry
{
public:
// the last observed modification time
time_t m_ctime;
// the last observed link count
int m_nlink;
entryStatus m_status;
entryMode m_mode;
bool isDir;
// instances interested in events
- QPtrList<Client> m_clients;
+ Q3PtrList<Client> m_clients;
// nonexistent entries of this directory
- QPtrList<Entry> m_entries;
+ Q3PtrList<Entry> m_entries;
QString path;
int msecLeft, freq;
void addClient(KDirWatch*);
void removeClient(KDirWatch*);
int clients();
bool isValid() { return m_clients.count() || m_entries.count(); }
#ifdef HAVE_FAM
FAMRequest fr;
#endif
#ifdef HAVE_DNOTIFY
int dn_fd;
bool dn_dirty;
@@ -111,43 +111,43 @@ public slots:
void famEventReceived(); // for FAM
void slotActivated(); // for DNOTIFY
void slotRemoveDelayed();
public:
QTimer *timer;
EntryMap m_mapEntries;
private:
int freq;
int statEntries;
int m_nfsPollInterval, m_PollInterval;
int m_ref;
bool useStat(Entry*);
bool delayRemove;
- QPtrList<Entry> removeList;
+ Q3PtrList<Entry> removeList;
#ifdef HAVE_FAM
QSocketNotifier *sn;
FAMConnection fc;
bool use_fam;
void checkFAMEvent(FAMEvent*);
bool useFAM(Entry*);
#endif
#ifdef HAVE_DNOTIFY
bool supports_dnotify;
bool rescan_all;
int mPipe[2];
QTimer mTimer;
QSocketNotifier *mSn;
- QIntDict<Entry> fd_Entry;
+ Q3IntDict<Entry> fd_Entry;
static void dnotify_handler(int, siginfo_t *si, void *);
static void dnotify_sigio_handler(int, siginfo_t *si, void *);
bool useDNotify(Entry*);
#endif
};
#endif // KDIRWATCH_P_H