svn merge svn+ssh://coolo@svn.kde.org/home/kde/trunk/KDE/kdebase@438057

svn+ssh://coolo@svn.kde.org/home/kde/branches/work/kde4/kdebase
          .

I couldn't resolve one kicker conflict that results from different
development directions, so I rely on Aaron to sort it out - the file
is commited with conflicts

svn path=/trunk/KDE/kdebase/konqueror/keditbookmarks/; revision=439627
This commit is contained in:
Stephan Kulow 2005-07-28 14:59:42 +00:00
parent 812c0f665a
commit e77f20dbaf
240 changed files with 2984 additions and 2383 deletions

View file

@ -33,6 +33,9 @@
#include <qpushbutton.h>
#include <qdir.h>
#include <qcheckbox.h>
//Added by qt3to4:
#include <QVBoxLayout>
#include <QHBoxLayout>
#include <kdialogbase.h>
#include <klocale.h>
@ -64,13 +67,13 @@ ChFaceDlg::ChFaceDlg(const QString& picsdir, QWidget *parent, const char *name,
top->addWidget( header );
m_FacesWidget = new KIconView( page );
m_FacesWidget->setSelectionMode( QIconView::Single );
m_FacesWidget->setSelectionMode( Q3IconView::Single );
m_FacesWidget->setItemsMovable( false );
m_FacesWidget->setMinimumSize( 400, 200 );
connect( m_FacesWidget, SIGNAL( selectionChanged( QIconViewItem * ) ), SLOT( slotFaceWidgetSelectionChanged( QIconViewItem * ) ) );
connect( m_FacesWidget, SIGNAL( selectionChanged( Q3IconViewItem * ) ), SLOT( slotFaceWidgetSelectionChanged( Q3IconViewItem * ) ) );
connect( m_FacesWidget, SIGNAL( doubleClicked( QIconViewItem *, const QPoint & ) ), SLOT( slotOk() ) );
connect( m_FacesWidget, SIGNAL( doubleClicked( Q3IconViewItem *, const QPoint & ) ), SLOT( slotOk() ) );
top->addWidget( m_FacesWidget );
@ -93,19 +96,19 @@ ChFaceDlg::ChFaceDlg(const QString& picsdir, QWidget *parent, const char *name,
{
QStringList picslist = facesDir.entryList( QDir::Files );
for ( QStringList::Iterator it = picslist.begin(); it != picslist.end(); ++it )
new QIconViewItem( m_FacesWidget, (*it).section(".",0,0), QPixmap( picsdir + *it ) );
new Q3IconViewItem( m_FacesWidget, (*it).section(".",0,0), QPixmap( picsdir + *it ) );
}
facesDir.setPath( KCFGUserAccount::userFaceDir() );
if ( facesDir.exists() )
{
QStringList picslist = facesDir.entryList( QDir::Files );
for ( QStringList::Iterator it = picslist.begin(); it != picslist.end(); ++it )
new QIconViewItem( m_FacesWidget, "/"+(*it) == KCFGUserAccount::customFaceFile() ?
new Q3IconViewItem( m_FacesWidget, "/"+(*it) == KCFGUserAccount::customFaceFile() ?
i18n("(Custom)") : (*it).section(".",0,0),
QPixmap( KCFGUserAccount::userFaceDir() + *it ) );
}
m_FacesWidget->setResizeMode( QIconView::Adjust );
m_FacesWidget->setResizeMode( Q3IconView::Adjust );
//m_FacesWidget->setGridX( FACE_PIX_SIZE - 10 );
m_FacesWidget->arrangeItemsInGrid();
@ -128,7 +131,7 @@ void ChFaceDlg::addCustomPixmap( QString imPath, bool saveCopy )
}
if ( (pix.width() > KCFGUserAccount::faceSize())
|| (pix.height() > KCFGUserAccount::faceSize()) )
pix = pix.scale( KCFGUserAccount::faceSize(), KCFGUserAccount::faceSize(), QImage::ScaleMin );// Should be no bigger than certain size.
pix = pix.scaled( KCFGUserAccount::faceSize(), KCFGUserAccount::faceSize(), Qt::ScaleMin );// Should be no bigger than certain size.
if ( saveCopy )
{
@ -145,7 +148,7 @@ void ChFaceDlg::addCustomPixmap( QString imPath, bool saveCopy )
#endif
}
QIconViewItem* newface = new QIconViewItem( m_FacesWidget, QFileInfo(imPath).fileName().section(".",0,0) , pix );
Q3IconViewItem* newface = new Q3IconViewItem( m_FacesWidget, QFileInfo(imPath).fileName().section(".",0,0) ,QPixmap( pix) );
newface->setKey( KCFGUserAccount::customKey() );// Add custom items to end
m_FacesWidget->ensureItemVisible( newface );
m_FacesWidget->setCurrentItem( newface );

View file

@ -29,6 +29,8 @@
#define CHFACEDLG_H
#include <qobject.h>
//Added by qt3to4:
#include <QPixmap>
#include <kiconview.h> // declaration below
@ -54,7 +56,7 @@ public:
}
private slots:
void slotFaceWidgetSelectionChanged( QIconViewItem *item )
void slotFaceWidgetSelectionChanged( Q3IconViewItem *item )
{ enableButtonOK( !item->pixmap()->isNull() ); }
void slotGetCustomImage();

View file

@ -16,7 +16,7 @@
#include <unistd.h>
#include <stdlib.h>
#include <qcstring.h>
#include <q3cstring.h>
#include <kdesu/process.h>
#include <kdebug.h>
@ -30,7 +30,7 @@ int ChfnProcess::exec(const char *pass, const char *name)
// of `chfn' easier.
putenv((char*)"LC_ALL=C");
QCStringList args;
QList<QByteArray> args;
args += "-f";
args += name;
int ret = PtyProcess::exec("chfn", args);
@ -52,7 +52,7 @@ int ChfnProcess::ConverseChfn(const char *pass)
{
int status=-1;
QCString line;
Q3CString line;
while(1)
{
line = readLine();

View file

@ -11,7 +11,7 @@
#ifndef CHFNPROC_H
#define CHFNPROC_H
#include <qcstring.h>
#include <QByteArray>
#include <kdesu/process.h>
class ChfnProcess : public PtyProcess
@ -22,12 +22,12 @@ public:
int exec(const char *pass, const char *name);
QCString error() { return m_Error; }
QByteArray error() { return m_Error; }
private:
int ConverseChfn(const char *pass);
QCString m_Error;
QByteArray m_Error;
};
#endif

View file

@ -23,12 +23,16 @@
#include <qlayout.h>
#include <qlabel.h>
#include <qlineedit.h>
#include <qbuttongroup.h>
#include <q3buttongroup.h>
#include <qevent.h>
#include <qpixmap.h>
#include <qcstring.h>
#include <q3cstring.h>
#include <qstringlist.h>
#include <qlayout.h>
//Added by qt3to4:
#include <QDragEnterEvent>
#include <QVBoxLayout>
#include <QDropEvent>
#include <kpushbutton.h>
#include <kguiitem.h>
@ -109,7 +113,7 @@ void KCMUserAccount::slotChangePassword()
{
KProcess *proc = new KProcess;
QString bin = KGlobal::dirs()->findExe("kdepasswd");
if ( !bin )
if ( bin.isNull() )
{
kdDebug() << "kcm_useraccount: kdepasswd was not found." << endl;
KMessageBox::sorry ( this, i18n( "A program error occurred: the internal "
@ -208,8 +212,8 @@ void KCMUserAccount::save()
/* Save realname to /etc/passwd */
if ( _mw->leRealname->isModified() )
{
QCString password;
int ret = KPasswordDialog::getPassword( password, i18n("Please enter "
Q3CString password;
int ret = KPasswordDialog::getPassword( _mw, password, i18n("Please enter "
"your password in order to save your settings:"));
if ( !ret )
@ -230,7 +234,7 @@ void KCMUserAccount::save()
{
KMessageBox::sorry( this, i18n("An error occurred and your password has "
"probably not been changed. The error "
"message was:\n%1").arg(proc->error()));
"message was:\n%1").arg(QString::fromLocal8Bit(proc->error())));
kdDebug() << "ChfnProcess->exec() failed. Error code: " << ret
<< "\nOutput:" << proc->error() << endl;
}

View file

@ -22,6 +22,10 @@
#include <kcmodule.h>
#include "main_widget.h"
//Added by qt3to4:
#include <QPixmap>
#include <QEvent>
#include <QDropEvent>
class KAboutData;
class KUser;

View file

@ -149,7 +149,7 @@
<cstring>spacer3</cstring>
</property>
<property name="orientation">
<enum>Vertical</enum>
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>Expanding</enum>
@ -183,7 +183,7 @@
<string></string>
</property>
<property name="alignment">
<set>AlignVCenter</set>
<set>Qt::AlignVCenter</set>
</property>
</widget>
<widget class="QLabel">
@ -194,7 +194,7 @@
<string>&lt;i&gt;(Click the button to change your image)&lt;/i&gt;</string>
</property>
<property name="alignment">
<set>AlignVCenter</set>
<set>Qt::AlignVCenter</set>
</property>
</widget>
</vbox>
@ -212,7 +212,7 @@
<cstring>spacer2</cstring>
</property>
<property name="orientation">
<enum>Horizontal</enum>
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>Expanding</enum>

View file

@ -47,7 +47,7 @@ int main(int argc, char **argv)
KUniqueApplication app;
KUser ku;
QCString user;
QByteArray user;
bool bRoot = ku.isSuperUser();
KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
@ -55,13 +55,13 @@ int main(int argc, char **argv)
user = args->arg(0);
/* You must be able to run "kdepasswd loginName" */
if ( !user.isEmpty() && user!=KUser().loginName().utf8() && !bRoot)
if ( !user.isEmpty() && user!=KUser().loginName().toUtf8() && !bRoot)
{
KMessageBox::sorry(0, i18n("You need to be root to change the password of other users."));
return 0;
}
QCString oldpass;
Q3CString oldpass;
if (!bRoot)
{
int result = KDEpasswd1Dialog::getPassword(oldpass);

View file

@ -23,8 +23,6 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <qcstring.h>
#include <kdebug.h>
#include <kstandarddirs.h>
@ -32,7 +30,7 @@
#include "passwd.h"
PasswdProcess::PasswdProcess(QCString user)
PasswdProcess::PasswdProcess(QByteArray user)
{
struct passwd *pw;
@ -82,7 +80,7 @@ int PasswdProcess::exec(const char *oldpass, const char *newpass,
// of `passwd' easier.
setenv("LANG","C", true /* override */);
QCStringList args;
QList<QByteArray> args;
if(bOtherUser)
args += m_User;
int ret = PtyProcess::exec("passwd", args);
@ -112,7 +110,7 @@ int PasswdProcess::exec(const char *oldpass, const char *newpass,
int PasswdProcess::ConversePasswd(const char *oldpass, const char *newpass,
int check)
{
QCString line, errline;
QByteArray line, errline;
int state = 0;
while (state != 7)
@ -252,7 +250,7 @@ int PasswdProcess::ConversePasswd(const char *oldpass, const char *newpass,
}
bool PasswdProcess::isPrompt(QCString line, const char *word)
bool PasswdProcess::isPrompt(QByteArray line, const char *word)
{
unsigned i, j, colon;
unsigned int lineLength(line.length());
@ -271,7 +269,7 @@ bool PasswdProcess::isPrompt(QCString line, const char *word)
return false;
if (word == 0L)
return true;
return line.contains(word, false);
return line.toLower().contains(word);
}

View file

@ -9,7 +9,7 @@
#ifndef __Passwd_h_Included__
#define __Passwd_h_Included__
#include <qcstring.h>
#include <qbytearray.h>
#include <kdesu/process.h>
/**
@ -20,7 +20,7 @@ class PasswdProcess
: public PtyProcess
{
public:
PasswdProcess(QCString user=0);
PasswdProcess(QByteArray user = QByteArray());
~PasswdProcess();
enum Errors { PasswdNotFound=1, PasswordIncorrect, PasswordNotGood };
@ -28,14 +28,14 @@ public:
int checkCurrent(const char *oldpass);
int exec(const char *oldpass, const char *newpass, int check=0);
QCString error() { return m_Error; }
QByteArray error() { return m_Error; }
private:
bool isPrompt(QCString line, const char *word=0L);
bool isPrompt(QByteArray line, const char *word=0L);
int ConversePasswd(const char *oldpass, const char *newpass,
int check);
QCString m_User, m_Error;
QByteArray m_User, m_Error;
bool bOtherUser;
};

View file

@ -11,6 +11,8 @@
#include "passwd.h"
#include "passwddlg.h"
//Added by qt3to4:
#include <Q3CString>
KDEpasswd1Dialog::KDEpasswd1Dialog()
@ -66,7 +68,7 @@ bool KDEpasswd1Dialog::checkPassword(const char *password)
// static
int KDEpasswd1Dialog::getPassword(QCString &password)
int KDEpasswd1Dialog::getPassword(QByteArray &password)
{
KDEpasswd1Dialog *dlg = new KDEpasswd1Dialog();
int res = dlg->exec();
@ -78,7 +80,7 @@ int KDEpasswd1Dialog::getPassword(QCString &password)
KDEpasswd2Dialog::KDEpasswd2Dialog(const char *oldpass, QCString user)
KDEpasswd2Dialog::KDEpasswd2Dialog(const char *oldpass, QByteArray user)
: KPasswordDialog(NewPassword, false, 0)
{
m_Pass = oldpass;
@ -88,7 +90,7 @@ KDEpasswd2Dialog::KDEpasswd2Dialog(const char *oldpass, QCString user)
if (m_User.isEmpty())
setPrompt(i18n("Please enter your new password:"));
else
setPrompt(i18n("Please enter the new password for user <b>%1</b>:").arg(m_User));
setPrompt(i18n("Please enter the new password for user <b>%1</b>:").arg(QString::fromLocal8Bit(m_User)));
}

View file

@ -10,6 +10,7 @@
#define __PasswdDlg_h_Incluced__
#include <kpassdlg.h>
#include <QByteArray>
class KDEpasswd1Dialog
: public KPasswordDialog
@ -20,7 +21,7 @@ public:
KDEpasswd1Dialog();
~KDEpasswd1Dialog();
static int getPassword(QCString &password);
static int getPassword(QByteArray &password);
protected:
bool checkPassword(const char *password);
@ -33,7 +34,7 @@ class KDEpasswd2Dialog
Q_OBJECT
public:
KDEpasswd2Dialog(const char *oldpass, QCString user);
KDEpasswd2Dialog(const char *oldpass, QByteArray user);
~KDEpasswd2Dialog();
protected:
@ -41,7 +42,7 @@ protected:
private:
const char *m_Pass;
QCString m_User;
QByteArray m_User;
};

View file

@ -24,11 +24,11 @@
#include <stdlib.h>
#include <iostream>
#include <qptrlist.h>
#include <qfile.h>
#include <qdatastream.h>
#include <qregexp.h>
#include <qtimer.h>
#include <qdesktopwidget.h>
#include <kmessagebox.h>
#include <kapplication.h>
#include <kdebug.h>
@ -106,10 +106,10 @@ class WinIdEmbedder: public QObject
{
public:
WinIdEmbedder(bool printID = false, WId winId = 0):
QObject(qApp), print(printID), id(winId)
QObject(kapp), print(printID), id(winId)
{
if (qApp)
qApp->installEventFilter(this);
if (kapp)
kapp->installEventFilter(this);
}
protected:
bool eventFilter(QObject *o, QEvent *e);
@ -173,7 +173,7 @@ static int directCommand(KCmdLineArgs *args)
WId id = 0;
if (embed) {
bool ok;
long l = args->getOption("embed").toLong(&ok);
long l = Q3CString(args->getOption("embed")).toLong(&ok);
if (ok)
id = (WId)l;
}
@ -182,7 +182,7 @@ static int directCommand(KCmdLineArgs *args)
// --yesno and other message boxes
KMessageBox::DialogType type = (KMessageBox::DialogType) 0;
QCString option;
Q3CString option;
if (args->isSet("yesno")) {
option = "yesno";
type = KMessageBox::QuestionYesNo;
@ -276,7 +276,7 @@ static int directCommand(KCmdLineArgs *args)
// --password text
if (args->isSet("password"))
{
QCString result;
Q3CString result;
bool retcode = Widgets::passwordBox(0, title, QString::fromLocal8Bit(args->getOption("password")), result);
cout << result.data() << endl;
return retcode ? 0 : 1;
@ -293,7 +293,7 @@ static int directCommand(KCmdLineArgs *args)
KPassivePopup *popup = KPassivePopup::message( KPassivePopup::Balloon, // style
title,
QString::fromLocal8Bit( args->getOption("passivepopup") ),
0, // icon
QPixmap() /* don't crash 0*/, // icon
(QWidget*)0UL, // parent
0, // name
duration );
@ -351,7 +351,7 @@ static int directCommand(KCmdLineArgs *args)
list.append(QString::fromLocal8Bit(args->arg(i)));
}
QCString result;
Q3CString result;
int ret = Widgets::textInputBox(0, w, h, title, list, result);
cout << result.data() << endl;
return ret;
@ -410,7 +410,7 @@ static int directCommand(KCmdLineArgs *args)
bool retcode = Widgets::checkList(0, title, text, list, separateOutput, result);
unsigned int i;
int i;
for (i=0; i<result.count(); i++)
if (!result[i].local8Bit().isEmpty()) {
cout << result[i].local8Bit().data() << endl;

View file

@ -18,8 +18,8 @@
//
#include <qlabel.h>
#include <qlistbox.h>
#include <qvbox.h>
#include <q3listbox.h>
#include <q3vbox.h>
#include "klistboxdialog.h"
#include "klistboxdialog.moc"
@ -29,12 +29,12 @@
KListBoxDialog::KListBoxDialog(QString text, QWidget *parent)
: KDialogBase( parent, 0, true, QString::null, Ok|Cancel, Ok, true )
{
QVBox *page = makeVBoxMainWidget();
Q3VBox *page = makeVBoxMainWidget();
label = new QLabel(text, page);
label->setAlignment(AlignCenter);
label->setAlignment(Qt::AlignCenter);
table = new QListBox(page);
table = new Q3ListBox(page);
table->setFocus();
}

View file

@ -32,7 +32,7 @@ public:
KListBoxDialog(QString text, QWidget *parent=0);
~KListBoxDialog() {};
QListBox &getTable() { return *table; };
Q3ListBox &getTable() { return *table; };
void insertItem( const QString& text );
void setCurrentItem ( const QString& text );
@ -40,7 +40,7 @@ public:
protected:
QListBox *table;
Q3ListBox *table;
QLabel *label;
};

View file

@ -32,8 +32,10 @@
#include <qlabel.h>
#include <ktextedit.h>
#include <qvbox.h>
#include <q3vbox.h>
#include <qfile.h>
#include <qdesktopwidget.h>
#include <qtextstream.h>
#if defined Q_WS_X11 && ! defined K_WS_QTONLY
#include <netwm.h>
@ -65,7 +67,7 @@ bool Widgets::inputBox(QWidget *parent, const QString& title, const QString& tex
return ok;
}
bool Widgets::passwordBox(QWidget *parent, const QString& title, const QString& text, QCString &result)
bool Widgets::passwordBox(QWidget *parent, const QString& title, const QString& text, Q3CString &result)
{
KPasswordDialog dlg( KPasswordDialog::Password, false, 0, parent );
@ -98,10 +100,10 @@ int Widgets::textBox(QWidget *parent, int width, int height, const QString& titl
}
QTextStream s(&f);
while (!s.eof())
while (!s.atEnd())
edit->append(s.readLine());
edit->moveCursor(QTextEdit::MoveHome, false);
edit->moveCursor(Q3TextEdit::MoveHome, false);
f.close();
@ -114,13 +116,13 @@ int Widgets::textBox(QWidget *parent, int width, int height, const QString& titl
return 0;
}
int Widgets::textInputBox(QWidget *parent, int width, int height, const QString& title, const QStringList& args, QCString &result)
int Widgets::textInputBox(QWidget *parent, int width, int height, const QString& title, const QStringList& args, Q3CString &result)
{
// KTextBox dlg(parent, 0, TRUE, width, height, file);
KDialogBase dlg( parent, 0, true, title, KDialogBase::Ok, KDialogBase::Ok );
kapp->setTopWidget( &dlg );
QVBox* vbox = dlg.makeVBoxMainWidget();
Q3VBox* vbox = dlg.makeVBoxMainWidget();
if( args.count() > 0 )
{
@ -153,7 +155,7 @@ bool Widgets::comboBox(QWidget *parent, const QString& title, const QString& tex
KDialogBase::Ok );
kapp->setTopWidget( &dlg );
QVBox* vbox = dlg.makeVBoxMainWidget();
Q3VBox* vbox = dlg.makeVBoxMainWidget();
QLabel label (vbox);
label.setText (text);
@ -179,7 +181,7 @@ bool Widgets::listBox(QWidget *parent, const QString& title, const QString& text
box.setCaption(title);
kapp->setTopWidget( &box );
for (unsigned int i = 0; i+1<args.count(); i += 2) {
for (int i = 0; i+1<args.count(); i += 2) {
box.insertItem(args[i+1]);
}
box.setCurrentItem( defaultEntry );
@ -202,12 +204,12 @@ bool Widgets::checkList(QWidget *parent, const QString& title, const QString& te
KListBoxDialog box(text,parent);
QListBox &table = box.getTable();
Q3ListBox &table = box.getTable();
box.setCaption(title);
kapp->setTopWidget( &box );
for (unsigned int i=0; i+2<args.count(); i += 3) {
for (int i=0; i+2<args.count(); i += 3) {
tags.append(args[i]);
entries.append(args[i+1]);
}
@ -216,7 +218,7 @@ bool Widgets::checkList(QWidget *parent, const QString& title, const QString& te
table.setMultiSelection(TRUE);
table.setCurrentItem(0); // This is to circumvent a Qt bug
for (unsigned int i=0; i+2<args.count(); i += 3) {
for (int i=0; i+2<args.count(); i += 3) {
table.setSelected( i/3, args[i+2] == QString::fromLatin1("on") );
}
@ -246,19 +248,19 @@ bool Widgets::radioBox(QWidget *parent, const QString& title, const QString& tex
KListBoxDialog box(text,parent);
QListBox &table = box.getTable();
Q3ListBox &table = box.getTable();
box.setCaption(title);
kapp->setTopWidget( &box );
for (unsigned int i=0; i+2<args.count(); i += 3) {
for (int i=0; i+2<args.count(); i += 3) {
tags.append(args[i]);
entries.append(args[i+1]);
}
table.insertStringList(entries);
for (unsigned int i=0; i+2<args.count(); i += 3) {
for (int i=0; i+2<args.count(); i += 3) {
table.setSelected( i/3, args[i+2] == QString::fromLatin1("on") );
}

View file

@ -23,13 +23,15 @@
#include <qwidget.h>
#include <qstring.h>
//Added by qt3to4:
#include <Q3CString>
namespace Widgets
{
bool inputBox(QWidget *parent, const QString& title, const QString& text, const QString& init, QString &result);
bool passwordBox(QWidget *parent, const QString& title, const QString& text, QCString &result);
bool passwordBox(QWidget *parent, const QString& title, const QString& text, Q3CString &result);
int textBox(QWidget *parent, int width, int height, const QString& title, const QString& file);
int textInputBox(QWidget *parent, int width, int height, const QString& title, const QStringList& args, QCString &result);
int textInputBox(QWidget *parent, int width, int height, const QString& title, const QStringList& args, Q3CString &result);
bool listBox(QWidget *parent, const QString& title, const QString& text, const QStringList& args, const QString &defaultEntry, QString &result);
bool checkList(QWidget *parent, const QString& title, const QString& text, const QStringList& args, bool separateOutput, QStringList &result);
bool radioBox(QWidget *parent, const QString& title, const QString& text, const QStringList& args, QString &result);

View file

@ -33,7 +33,7 @@
#include <stdlib.h>
#include <qclipboard.h>
#include <qpopupmenu.h>
#include <q3popupmenu.h>
#include <qpainter.h>
#include <klocale.h>
@ -105,16 +105,16 @@ void KEBApp::createActions() {
// actions
(void) new KAction(
i18n("&Delete"), "editdelete", Key_Delete,
i18n("&Delete"), "editdelete", Qt::Key_Delete,
actn, SLOT( slotDelete() ), actionCollection(), "delete");
(void) new KAction(
i18n("Rename"), "text", Key_F2,
i18n("Rename"), "text", Qt::Key_F2,
actn, SLOT( slotRename() ), actionCollection(), "rename");
(void) new KAction(
i18n("C&hange URL"), "text", Key_F3,
i18n("C&hange URL"), "text", Qt::Key_F3,
actn, SLOT( slotChangeURL() ), actionCollection(), "changeurl");
(void) new KAction(
i18n("C&hange Comment"), "text", Key_F4,
i18n("C&hange Comment"), "text", Qt::Key_F4,
actn, SLOT( slotChangeComment() ), actionCollection(), "changecomment");
(void) new KAction(
i18n("Chan&ge Icon..."), "icons", 0,
@ -126,13 +126,13 @@ void KEBApp::createActions() {
i18n("Recursive Sort"), 0,
actn, SLOT( slotRecursiveSort() ), actionCollection(), "recursivesort");
(void) new KAction(
i18n("&New Folder..."), "folder_new", CTRL+Key_N,
i18n("&New Folder..."), "folder_new", Qt::Key_Control+Qt::Key_N,
actn, SLOT( slotNewFolder() ), actionCollection(), "newfolder");
(void) new KAction(
i18n("&New Bookmark"), "www", 0,
actn, SLOT( slotNewBookmark() ), actionCollection(), "newbookmark");
(void) new KAction(
i18n("&Insert Separator"), CTRL+Key_I,
i18n("&Insert Separator"), Qt::Key_Control+Qt::Key_I,
actn, SLOT( slotInsertSeparator() ), actionCollection(),
"insertseparator");
(void) new KAction(
@ -339,7 +339,7 @@ void ActionsImpl::slotCopy() {
KEBApp::self()->bkInfo()->commitChanges();
// this is not a command, because it can't be undone
Q_ASSERT(ListView::self()->selectedItemsMap().count() != 0);
QValueList<KBookmark> bookmarks
Q3ValueList<KBookmark> bookmarks
= ListView::self()->itemsToBookmarks(ListView::self()->selectedItemsMap());
KBookmarkDrag* data = KBookmarkDrag::newDrag(bookmarks, 0 /* not this ! */);
kapp->clipboard()->setData(data, QClipboard::Selection);
@ -419,7 +419,7 @@ void ActionsImpl::slotExportMoz() {
/* -------------------------------------- */
static QCString s_appId, s_objId;
static Q3CString s_appId, s_objId;
static KParts::ReadOnlyPart *s_part;
void ActionsImpl::slotPrint() {
@ -506,21 +506,21 @@ void ActionsImpl::slotUpdateFavIcon() {
class KBookmarkGroupList : private KBookmarkGroupTraverser {
public:
KBookmarkGroupList(KBookmarkManager *);
QValueList<KBookmark> getList(const KBookmarkGroup &);
Q3ValueList<KBookmark> getList(const KBookmarkGroup &);
private:
virtual void visit(const KBookmark &) { ; }
virtual void visitEnter(const KBookmarkGroup &);
virtual void visitLeave(const KBookmarkGroup &) { ; }
private:
KBookmarkManager *m_manager;
QValueList<KBookmark> m_list;
Q3ValueList<KBookmark> m_list;
};
KBookmarkGroupList::KBookmarkGroupList( KBookmarkManager *manager ) {
m_manager = manager;
}
QValueList<KBookmark> KBookmarkGroupList::getList( const KBookmarkGroup &grp ) {
Q3ValueList<KBookmark> KBookmarkGroupList::getList( const KBookmarkGroup &grp ) {
traverse(grp);
return m_list;
}
@ -535,9 +535,9 @@ void ActionsImpl::slotRecursiveSort() {
Q_ASSERT(bk.isGroup());
KEBMacroCommand *mcmd = new KEBMacroCommand(i18n("Recursive Sort"));
KBookmarkGroupList lister(CurrentMgr::self()->mgr());
QValueList<KBookmark> bookmarks = lister.getList(bk.toGroup());
Q3ValueList<KBookmark> bookmarks = lister.getList(bk.toGroup());
bookmarks << bk.toGroup();
for (QValueListConstIterator<KBookmark> it = bookmarks.begin(); it != bookmarks.end(); ++it) {
for (Q3ValueListConstIterator<KBookmark> it = bookmarks.begin(); it != bookmarks.end(); ++it) {
SortCommand *cmd = new SortCommand("", (*it).address());
cmd->execute();
mcmd->addCommand(cmd);
@ -563,8 +563,9 @@ void ActionsImpl::slotDelete() {
void ActionsImpl::slotOpenLink() {
KEBApp::self()->bkInfo()->commitChanges();
QValueList<KBookmark> bks = ListView::self()->itemsToBookmarks(ListView::self()->selectedItemsMap());
QValueListIterator<KBookmark> it;
//Q3ValueList<KBookmark> bks = ListView::self()->itemsToBookmarks(ListView::self()->selectedItemsMap());
Q3ValueList<KBookmark> bks = ListView::self()->itemsToBookmarks(ListView::self()->selectedItemsMap());
Q3ValueListIterator<KBookmark> it;
for (it = bks.begin(); it != bks.end(); ++it) {
if ((*it).isGroup() || (*it).isSeparator())
continue;

View file

@ -28,6 +28,10 @@
#include <qsplitter.h>
#include <qlayout.h>
#include <qlabel.h>
//Added by qt3to4:
#include <QVBoxLayout>
#include <QGridLayout>
#include <QBoxLayout>
#include <klocale.h>
#include <kdebug.h>

View file

@ -28,7 +28,7 @@
#include <qtimer.h>
BookmarkIterator::BookmarkIterator(QValueList<KBookmark> bks) : m_bklist(bks) {
BookmarkIterator::BookmarkIterator(Q3ValueList<KBookmark> bks) : m_bklist(bks) {
connect(this, SIGNAL( deleteSelf(BookmarkIterator *) ),
SLOT( slotCancelTest(BookmarkIterator *) ));
delayedEmitNextOne();
@ -65,7 +65,7 @@ void BookmarkIterator::nextOne() {
return;
}
QValueListIterator<KBookmark> head = m_bklist.begin();
Q3ValueListIterator<KBookmark> head = m_bklist.begin();
KBookmark bk = (*head);
bool viable = bk.hasParent() && isApplicable(bk);

View file

@ -22,7 +22,9 @@
#define __bookmarkiterator_h
#include <qobject.h>
#include <qptrlist.h>
#include <q3ptrlist.h>
//Added by qt3to4:
#include <Q3ValueList>
#include <kbookmark.h>
class KEBListViewItem;
@ -33,7 +35,7 @@ class BookmarkIterator : public QObject
Q_OBJECT
public:
BookmarkIterator(QValueList<KBookmark> bks);
BookmarkIterator(Q3ValueList<KBookmark> bks);
virtual ~BookmarkIterator();
virtual BookmarkIteratorHolder* holder() const = 0;
@ -53,7 +55,7 @@ protected:
private:
KBookmark m_bk;
QValueList<KBookmark> m_bklist;
Q3ValueList<KBookmark> m_bklist;
};
class BookmarkIteratorHolder
@ -68,7 +70,7 @@ protected:
virtual void doItrListChanged() = 0;
int count() const { return m_itrs.count(); }
private:
QPtrList<BookmarkIterator> m_itrs;
Q3PtrList<BookmarkIterator> m_itrs;
};
#endif

View file

@ -27,7 +27,7 @@
#include "listview.h"
#include <assert.h>
#include <qvaluevector.h>
#include <q3valuevector.h>
#include <kdebug.h>
#include <klocale.h>
@ -37,10 +37,13 @@
#include <kurldrag.h>
#include <kdesktopfile.h>
//Added by qt3to4:
#include <Q3ValueList>
#include <Q3PtrList>
QString KEBMacroCommand::affectedBookmarks() const
{
QPtrListIterator<KCommand> it(m_commands);
Q3PtrListIterator<KCommand> it(m_commands);
QString affectBook;
if(it.current())
affectBook = dynamic_cast<IKEBCommand *>(it.current())->affectedBookmarks();
@ -72,9 +75,9 @@ QString DeleteManyCommand::preOrderNextAddress(QString addr)
return QString::null;
}
bool DeleteManyCommand::isConsecutive(const QValueList<QString> & addresses)
bool DeleteManyCommand::isConsecutive(const Q3ValueList<QString> & addresses)
{
QValueList<QString>::const_iterator it, end;
Q3ValueList<QString>::const_iterator it, end;
it = addresses.begin();
end = addresses.end();
QString addr = *(addresses.begin());
@ -88,10 +91,10 @@ bool DeleteManyCommand::isConsecutive(const QValueList<QString> & addresses)
}
DeleteManyCommand::DeleteManyCommand(const QString &name, const QValueList<QString> & addresses)
DeleteManyCommand::DeleteManyCommand(const QString &name, const Q3ValueList<QString> & addresses)
: KEBMacroCommand(name)
{
QValueList<QString>::const_iterator it, begin;
Q3ValueList<QString>::const_iterator it, begin;
begin = addresses.begin();
it = addresses.end();
while(begin != it)
@ -119,7 +122,7 @@ DeleteManyCommand::DeleteManyCommand(const QString &name, const QValueList<QStri
// Check if all bookmarks are consecutive
if(isConsecutive(addresses)) // Mark next bookmark after all selected
{ // That's a little work...
QValueList<QString>::const_iterator last = addresses.end();
Q3ValueList<QString>::const_iterator last = addresses.end();
--last;
if( CurrentMgr::bookmarkAt( KBookmark::nextAddress(*last) ).hasParent() )
m_currentAddress = *begin;
@ -132,7 +135,7 @@ DeleteManyCommand::DeleteManyCommand(const QString &name, const QValueList<QStri
}
else // not consecutive, select the common parent (This could be more clever)
{
QValueList<QString>::const_iterator jt, end;
Q3ValueList<QString>::const_iterator jt, end;
end = addresses.end();
m_currentAddress = *begin;
for( jt = addresses.begin(); jt != end; ++jt)
@ -248,7 +251,7 @@ void EditCommand::execute() {
m_reverseEditions.clear();
QValueList<Edition>::Iterator it = m_editions.begin();
Q3ValueList<Edition>::Iterator it = m_editions.begin();
for ( ; it != m_editions.end() ; ++it) {
// backup current value
@ -276,8 +279,8 @@ QString EditCommand::affectedBookmarks() const
void EditCommand::modify(const QString & a, const QString & v)
{
QValueList<Edition>::Iterator it = m_editions.begin();
QValueList<Edition>::Iterator end = m_editions.end();
Q3ValueList<Edition>::Iterator it = m_editions.begin();
Q3ValueList<Edition>::Iterator end = m_editions.end();
for ( ; it != end; ++it)
{
if( (*it).attr == a)
@ -597,14 +600,14 @@ KEBMacroCommand* CmdGen::setAsToolbar(const KBookmark &bk) {
KBookmarkGroup oldToolbar = CurrentMgr::self()->mgr()->toolbar();
if (!oldToolbar.isNull()) {
QValueList<EditCommand::Edition> lst;
Q3ValueList<EditCommand::Edition> lst;
lst.append(EditCommand::Edition("toolbar", "no"));
lst.append(EditCommand::Edition("icon", ""));
EditCommand *cmd1 = new EditCommand(oldToolbar.address(), lst);
mcmd->addCommand(cmd1);
}
QValueList<EditCommand::Edition> lst;
Q3ValueList<EditCommand::Edition> lst;
lst.append(EditCommand::Edition("toolbar", "yes"));
lst.append(EditCommand::Edition("icon", "bookmark_toolbar"));
// TODO - see below
@ -623,7 +626,7 @@ KEBMacroCommand* CmdGen::setShownInToolbar(const KBookmark &bk, bool show) {
: i18n("Hide"));
KEBMacroCommand *mcmd = new KEBMacroCommand(i18n_name);
QValueList<EditCommand::Edition> lst;
Q3ValueList<EditCommand::Edition> lst;
lst.append(EditCommand::Edition("showintoolbar", show ? "yes" : "no"));
EditCommand *cmd2 = new EditCommand(bk.address(), lst);
mcmd->addCommand(cmd2);
@ -643,7 +646,7 @@ KEBMacroCommand* CmdGen::insertMimeSource(
// or not. so, we search. sucky...
if (strcmp(format, "GALEON_BOOKMARK") == 0) {
modified = true;
QStoredDrag *mydrag = new QStoredDrag("application/x-xbel");
Q3StoredDrag *mydrag = new Q3StoredDrag("application/x-xbel");
mydrag->setEncodedData(data->encodedData("GALEON_BOOKMARK"));
data = mydrag;
break;
@ -656,7 +659,7 @@ KEBMacroCommand* CmdGen::insertMimeSource(
continue; // break out of format loop
KURL::List::ConstIterator uit = uris.begin();
KURL::List::ConstIterator uEnd = uris.end();
QValueList<KBookmark> urlBks;
Q3ValueList<KBookmark> urlBks;
for ( ; uit != uEnd ; ++uit ) {
if (!(*uit).url().endsWith(".desktop")) {
urlBks << KBookmark::standaloneBookmark((*uit).prettyURL(), (*uit));
@ -682,8 +685,8 @@ KEBMacroCommand* CmdGen::insertMimeSource(
}
KEBMacroCommand *mcmd = new KEBMacroCommand(cmdName);
QString currentAddress = addr;
QValueList<KBookmark> bookmarks = KBookmarkDrag::decode(data);
for (QValueListConstIterator<KBookmark> it = bookmarks.begin();
Q3ValueList<KBookmark> bookmarks = KBookmarkDrag::decode(data);
for (Q3ValueListConstIterator<KBookmark> it = bookmarks.begin();
it != bookmarks.end(); ++it) {
CreateCommand *cmd = new CreateCommand(currentAddress, (*it));
cmd->execute();
@ -700,8 +703,8 @@ KEBMacroCommand* CmdGen::itemsMoved(const QMap<KEBListViewItem *, bool> & items,
KEBMacroCommand *mcmd = new KEBMacroCommand(copy ? i18n("Copy Items")
: i18n("Move Items"));
QValueList<KBookmark> list = ListView::self()->itemsToBookmarks( items );
QValueList<KBookmark>::const_iterator it, end;
Q3ValueList<KBookmark> list = ListView::self()->itemsToBookmarks( items );
Q3ValueList<KBookmark>::const_iterator it, end;
it = list.begin();
end = list.end();

View file

@ -23,6 +23,11 @@
#include <kcommand.h>
#include <kbookmark.h>
//Added by qt3to4:
#include <QMap>
#include <Q3ValueList>
#include <Q3PtrList>
#include <Q3MimeSourceFactory>
// Interface adds the affectedBookmarks method
// Any class should on call add those bookmarks which are
@ -50,13 +55,13 @@ public:
class DeleteManyCommand : public KEBMacroCommand
{
public:
DeleteManyCommand(const QString &name, const QValueList<QString> & addresses);
DeleteManyCommand(const QString &name, const Q3ValueList<QString> & addresses);
virtual ~DeleteManyCommand() {};
virtual QString currentAddress() const;
private:
QString prevOrParentAddress(QString addr);
QString preOrderNextAddress(QString addr);
bool isConsecutive(const QValueList<QString> & addresses);
bool isConsecutive(const Q3ValueList<QString> & addresses);
QString m_currentAddress;
};
@ -132,7 +137,7 @@ public:
// change multiple attributes
EditCommand(const QString &address,
const QValueList<Edition> &editions,
const Q3ValueList<Edition> &editions,
const QString &name = QString::null)
: KCommand(), m_address(address), m_editions(editions), m_mytext(name)
{ ; }
@ -146,8 +151,8 @@ public:
virtual QString affectedBookmarks() const;
private:
QString m_address;
QValueList<Edition> m_editions;
QValueList<Edition> m_reverseEditions;
Q3ValueList<Edition> m_editions;
Q3ValueList<Edition> m_reverseEditions;
QString m_mytext;
};

View file

@ -27,7 +27,7 @@
#include <stdlib.h>
#include <qclipboard.h>
#include <qpopupmenu.h>
#include <q3popupmenu.h>
#include <qpainter.h>
#include <klocale.h>

View file

@ -25,14 +25,16 @@
#include <kapplication.h>
#include <qfile.h>
//Added by qt3to4:
#include <QTextStream>
HTMLExporter::HTMLExporter()
: m_out(&m_string, IO_WriteOnly) {
: m_out(&m_string, QIODevice::WriteOnly) {
}
void HTMLExporter::write(const KBookmarkGroup &grp, const QString &filename, bool showAddress) {
QFile file(filename);
if (!file.open(IO_WriteOnly)) {
if (!file.open(QIODevice::WriteOnly)) {
kdError(7043) << "Can't write to file " << filename << endl;
return;
}

View file

@ -20,6 +20,8 @@
#define __exporters_h
#include <kbookmark.h>
//Added by qt3to4:
#include <QTextStream>
class HTMLExporter : private KBookmarkGroupTraverser {
public:

View file

@ -59,7 +59,7 @@ void FavIconsItrHolder::addAffectedBookmark( const QString & address )
/* -------------------------- */
FavIconsItr::FavIconsItr(QValueList<KBookmark> bks)
FavIconsItr::FavIconsItr(Q3ValueList<KBookmark> bks)
: BookmarkIterator(bks) {
m_updater = 0;
}

View file

@ -28,6 +28,8 @@
#include <kparts/browserinterface.h>
#include "bookmarkiterator.h"
//Added by qt3to4:
#include <Q3ValueList>
class FavIconsItrHolder : public BookmarkIteratorHolder {
public:
@ -50,7 +52,7 @@ class FavIconsItr : public BookmarkIterator
Q_OBJECT
public:
FavIconsItr(QValueList<KBookmark> bks);
FavIconsItr(Q3ValueList<KBookmark> bks);
~FavIconsItr();
virtual FavIconsItrHolder* holder() const { return FavIconsItrHolder::self(); }

View file

@ -26,6 +26,9 @@
#include "listview.h"
#include <qregexp.h>
//Added by qt3to4:
#include <Q3ValueList>
#include <Q3CString>
#include <kdebug.h>
#include <klocale.h>
@ -48,7 +51,7 @@ QString ImportCommand::folder() const {
return m_folder ? i18n("%1 Bookmarks").arg(visibleName()) : QString::null;
}
ImportCommand* ImportCommand::importerFactory(const QCString &type) {
ImportCommand* ImportCommand::importerFactory(const Q3CString &type) {
if (type == "Galeon") return new GaleonImportCommand();
else if (type == "IE") return new IEImportCommand();
else if (type == "KDE2") return new KDE2ImportCommand();
@ -62,7 +65,7 @@ ImportCommand* ImportCommand::importerFactory(const QCString &type) {
}
}
ImportCommand* ImportCommand::performImport(const QCString &type, QWidget *top) {
ImportCommand* ImportCommand::performImport(const Q3CString &type, QWidget *top) {
ImportCommand *importer = ImportCommand::importerFactory(type);
QString mydirname = importer->requestFilename();
@ -273,7 +276,7 @@ void XBELImportCommand::doExecute(const KBookmarkGroup &/*bkGroup*/) {
} else {
QDomElement root = CurrentMgr::self()->mgr()->root().internalElement();
QValueList<QDomElement> childList;
Q3ValueList<QDomElement> childList;
QDomNode n = subDoc.firstChild().toElement();
while (!n.isNull()) {
@ -283,8 +286,8 @@ void XBELImportCommand::doExecute(const KBookmarkGroup &/*bkGroup*/) {
n = n.nextSibling();
}
QValueList<QDomElement>::Iterator it = childList.begin();
QValueList<QDomElement>::Iterator end = childList.end();
Q3ValueList<QDomElement>::Iterator it = childList.begin();
Q3ValueList<QDomElement>::Iterator end = childList.end();
for (; it!= end ; ++it)
root.appendChild((*it));
}

View file

@ -29,7 +29,7 @@
#include <kcommand.h>
#include <kbookmark.h>
#include <qptrstack.h>
#include <q3ptrstack.h>
#include <qobject.h>
// part pure
@ -47,8 +47,8 @@ public:
virtual QString visibleName() const { return m_visibleName; }
virtual QString requestFilename() const = 0;
static ImportCommand* performImport(const QCString &, QWidget *);
static ImportCommand* importerFactory(const QCString &);
static ImportCommand* performImport(const Q3CString &, QWidget *);
static ImportCommand* importerFactory(const Q3CString &);
virtual ~ImportCommand()
{ ; }

View file

@ -34,7 +34,7 @@ KEBSearchLine::~KEBSearchLine()
{
}
bool KEBSearchLine::itemMatches(const QListViewItem *item, const QString &s) const
bool KEBSearchLine::itemMatches(const Q3ListViewItem *item, const QString &s) const
{
if(mmode == EXACTLY)
return KListViewSearchLine::itemMatches(item, s);

View file

@ -37,7 +37,7 @@ public:
protected:
virtual bool itemMatches(const QListViewItem *item, const QString &s) const;
virtual bool itemMatches(const Q3ListViewItem *item, const QString &s) const;
private:
mutable QString lastpattern; // what was cached

View file

@ -30,10 +30,16 @@
#include <stdlib.h>
#include <qclipboard.h>
#include <qpopupmenu.h>
#include <q3popupmenu.h>
#include <qpainter.h>
#include <qheader.h>
#include <qvaluevector.h>
#include <q3header.h>
//Added by qt3to4:
#include <Q3PtrList>
#include <QKeyEvent>
#include <QEvent>
#include <QDropEvent>
#include <Q3ValueList>
#include <Q3ValueVector>
#include <klocale.h>
#include <dcopclient.h>
@ -52,6 +58,7 @@
#include <kbookmarkdrag.h>
#include <kbookmarkmanager.h>
#include <q3tl.h>
// #define DEBUG_ADDRESSES
@ -75,7 +82,7 @@ ListView::~ListView() {
void ListView::createListViews(QSplitter *splitter) {
s_self = new ListView();
self()->m_listView = new KEBListView(splitter, false);
splitter->setSizes(QValueList<int>() << 100 << 300);
splitter->setSizes(Q3ValueList<int>() << 100 << 300);
}
void ListView::initListViews() {
@ -143,10 +150,9 @@ bool operator<(const KBookmark & first, const KBookmark & second) //FIXME Using
}
QValueList<KBookmark> ListView::itemsToBookmarks(const QMap<KEBListViewItem *, bool> & items) const
Q3ValueList<KBookmark> ListView::itemsToBookmarks(const QMap<KEBListViewItem *, bool> & items) const
{
QValueList<KBookmark> bookmarks; //TODO optimize by using a QValueVector
Q3ValueList<KBookmark> bookmarks; //TODO optimize by using a Q3ValueVector
QMap<KEBListViewItem *, bool>::const_iterator it = items.begin();
QMap<KEBListViewItem *, bool>::const_iterator end = items.end();
for( ; it!=end; ++it)
@ -163,7 +169,7 @@ void ListView::invalidate(const QString & address)
invalidate(getItemAtAddress(address));
}
void ListView::invalidate(QListViewItem * item)
void ListView::invalidate(Q3ListViewItem * item)
{
if(item->isSelected())
{
@ -178,7 +184,7 @@ void ListView::invalidate(QListViewItem * item)
m_needToFixUp = true;
}
QListViewItem * child = item->firstChild();
Q3ListViewItem * child = item->firstChild();
while(child)
{
//invalidate(child);
@ -192,7 +198,7 @@ void ListView::fixUpCurrent(const QString & address)
return;
m_needToFixUp = false;
QListViewItem * item;
Q3ListViewItem * item;
if(mSelectedItems.count() != 0)
{
QString least = mSelectedItems.begin().key()->bookmark().address();
@ -264,11 +270,11 @@ void ListView::deselectAllChildren(KEBListViewItem *item)
}
}
QValueList<QString> ListView::selectedAddresses()
Q3ValueList<QString> ListView::selectedAddresses()
{
QValueList<QString> addresses;
QValueList<KBookmark> bookmarks = itemsToBookmarks( selectedItemsMap() );
QValueList<KBookmark>::const_iterator it, end;
Q3ValueList<QString> addresses;
Q3ValueList<KBookmark> bookmarks = itemsToBookmarks( selectedItemsMap() );
Q3ValueList<KBookmark>::const_iterator it, end;
end = bookmarks.end();
for( it = bookmarks.begin(); it != end; ++it)
addresses.append( (*it).address() );
@ -276,9 +282,9 @@ QValueList<QString> ListView::selectedAddresses()
}
QValueList<KBookmark> ListView::selectedBookmarksExpanded() const {
QValueList<KBookmark> bookmarks;
for (QListViewItemIterator it(m_listView); it.current() != 0; ++it) {
Q3ValueList<KBookmark> ListView::selectedBookmarksExpanded() const {
Q3ValueList<KBookmark> bookmarks;
for (Q3ListViewItemIterator it(m_listView); it.current() != 0; ++it) {
if (!it.current()->isSelected())
continue;
if(it.current() == m_listView->firstChild()) // root case
@ -291,8 +297,7 @@ QValueList<KBookmark> ListView::selectedBookmarksExpanded() const {
return bookmarks;
}
void ListView::selectedBookmarksExpandedHelper(KEBListViewItem * item, QValueList<KBookmark> & bookmarks) const
void ListView::selectedBookmarksExpandedHelper(KEBListViewItem * item, Q3ValueList<KBookmark> & bookmarks) const
{
KEBListViewItem* child = static_cast<KEBListViewItem *>(item->firstChild());
while( child )
@ -305,9 +310,9 @@ void ListView::selectedBookmarksExpandedHelper(KEBListViewItem * item, QValueLis
}
}
QValueList<KBookmark> ListView::allBookmarks() const {
QValueList<KBookmark> bookmarks;
for (QListViewItemIterator it(m_listView); it.current() != 0; ++it)
Q3ValueList<KBookmark> ListView::allBookmarks() const {
Q3ValueList<KBookmark> bookmarks;
for (Q3ListViewItemIterator it(m_listView); it.current() != 0; ++it)
{
KEBListViewItem * item = static_cast<KEBListViewItem *>(it.current());
if (!item->isEmptyFolderPadder() && (item->childCount() == 0))
@ -337,7 +342,7 @@ void ListView::setCurrent(KEBListViewItem *item, bool select) {
KEBListViewItem* ListView::getItemAtAddress(const QString &address) const {
//FIXME uses internal represantation of bookmark address
QListViewItem *item = m_listView->rootItem();
Q3ListViewItem *item = m_listView->rootItem();
QStringList addresses = QStringList::split('/',address); // e.g /5/10/2
@ -352,7 +357,7 @@ KEBListViewItem* ListView::getItemAtAddress(const QString &address) const {
}
void ListView::setOpen(bool open) {
for (QListViewItemIterator it(m_listView); it.current() != 0; ++it)
for (Q3ListViewItemIterator it(m_listView); it.current() != 0; ++it)
if (it.current()->parent())
it.current()->setOpen(open);
}
@ -377,7 +382,7 @@ SelcAbilities ListView::getSelectionAbilities() const {
return sa;
}
void ListView::handleDropped(KEBListView *, QDropEvent *e, QListViewItem *newParent, QListViewItem *itemAfterQLVI) {
void ListView::handleDropped(KEBListView *, QDropEvent *e, Q3ListViewItem *newParent, Q3ListViewItem *itemAfterQLVI) {
bool inApp = (e->source() == m_listView->viewport());
// drop before root item
@ -452,7 +457,7 @@ void ListView::fillWithGroup(KEBListView *lv, KBookmarkGroup group, KEBListViewI
lv->clear();
KEBListViewItem *tree = new KEBListViewItem(lv, group);
fillWithGroup(lv, group, tree);
tree->QListViewItem::setOpen(true);
tree->Q3ListViewItem::setOpen(true);
if (s_selected_addresses.contains(tree->bookmark().address()))
lv->setSelected(tree, true);
if(!s_current_address.isNull() && s_current_address == tree->bookmark().address())
@ -468,7 +473,7 @@ void ListView::fillWithGroup(KEBListView *lv, KBookmarkGroup group, KEBListViewI
: new KEBListViewItem(lv, lastItem, grp);
fillWithGroup(lv, grp, item);
if (grp.isOpen())
item->QListViewItem::setOpen(true);
item->Q3ListViewItem::setOpen(true);
if (grp.first().isNull())
new KEBListViewItem(item, item); // empty folder
lastItem = item;
@ -516,7 +521,7 @@ void ListView::slotBkInfoUpdateListViewItem() {
i->setText(KEBListView::CommentColumn, commentStr);
}
void ListView::handleContextMenu(KEBListView *, KListView *, QListViewItem *qitem, const QPoint &p) {
void ListView::handleContextMenu(KEBListView *, KListView *, Q3ListViewItem *qitem, const QPoint &p) {
KEBListViewItem *item = static_cast<KEBListViewItem *>(qitem);
const char *type = ( !item
|| (item == m_listView->rootItem())
@ -525,14 +530,14 @@ void ListView::handleContextMenu(KEBListView *, KListView *, QListViewItem *qite
? "popup_folder" : "popup_bookmark";
QWidget* popup = KEBApp::self()->popupMenuFactory(type);
if (popup)
static_cast<QPopupMenu*>(popup)->popup(p);
static_cast<Q3PopupMenu*>(popup)->popup(p);
}
void ListView::handleDoubleClicked(KEBListView *lv, QListViewItem *item, const QPoint &, int column) {
void ListView::handleDoubleClicked(KEBListView *lv, Q3ListViewItem *item, const QPoint &, int column) {
lv->rename(item, column);
}
void ListView::handleItemRenamed(KEBListView *lv, QListViewItem *item, const QString &newText, int column) {
void ListView::handleItemRenamed(KEBListView *lv, Q3ListViewItem *item, const QString &newText, int column) {
Q_ASSERT(item);
KBookmark bk = static_cast<KEBListViewItem *>(item)->bookmark();
KCommand *cmd = 0;
@ -552,7 +557,7 @@ void ListView::handleItemRenamed(KEBListView *lv, QListViewItem *item, const QSt
}
} else if (column == KEBListView::CommentColumn && !lv->isFolderList()) {
if (NodeEditCommand::getNodeText(bk, "desc") != newText)
if (NodeEditCommand::getNodeText(bk, QStringList() << "desc") != newText)
cmd = new NodeEditCommand(bk.address(), newText, "desc");
}
CmdHistory::self()->addCommand(cmd);
@ -619,10 +624,10 @@ bool KeyPressEater::eventFilter(QObject *, QEvent *pe) {
if (pe->type() == QEvent::KeyPress) {
QKeyEvent *k = (QKeyEvent *) pe;
if ((k->key() == Qt::Key_Backtab || k->key() == Qt::Key_Tab)
&& !(k->state() & ControlButton || k->state() & AltButton)
&& !(k->state() & Qt::ControlModifier || k->state() & Qt::AltModifier)
) {
if (m_allowedToTab) {
bool fwd = (k->key() == Key_Tab && !(k->state() & ShiftButton));
bool fwd = (k->key() == Qt::Key_Tab && !(k->state() & Qt::ShiftModifier));
ListView::self()->renameNextCell(fwd);
}
return true;
@ -695,14 +700,14 @@ void KEBListView::init() {
void KEBListView::makeConnections() {
connect(this, SIGNAL( moved() ),
SLOT( slotMoved() ));
connect(this, SIGNAL( contextMenu(KListView *, QListViewItem*, const QPoint &) ),
SLOT( slotContextMenu(KListView *, QListViewItem *, const QPoint &) ));
connect(this, SIGNAL( itemRenamed(QListViewItem *, const QString &, int) ),
SLOT( slotItemRenamed(QListViewItem *, const QString &, int) ));
connect(this, SIGNAL( doubleClicked(QListViewItem *, const QPoint &, int) ),
SLOT( slotDoubleClicked(QListViewItem *, const QPoint &, int) ));
connect(this, SIGNAL( dropped(QDropEvent*, QListViewItem*, QListViewItem*) ),
SLOT( slotDropped(QDropEvent*, QListViewItem*, QListViewItem*) ));
connect(this, SIGNAL( contextMenu(KListView *, Q3ListViewItem*, const QPoint &) ),
SLOT( slotContextMenu(KListView *, Q3ListViewItem *, const QPoint &) ));
connect(this, SIGNAL( itemRenamed(Q3ListViewItem *, const QString &, int) ),
SLOT( slotItemRenamed(Q3ListViewItem *, const QString &, int) ));
connect(this, SIGNAL( doubleClicked(Q3ListViewItem *, const QPoint &, int) ),
SLOT( slotDoubleClicked(Q3ListViewItem *, const QPoint &, int) ));
connect(this, SIGNAL( dropped(QDropEvent*, Q3ListViewItem*, Q3ListViewItem*) ),
SLOT( slotDropped(QDropEvent*, Q3ListViewItem*, Q3ListViewItem*) ));
}
void KEBListView::readonlyFlagInit(bool readonly) {
@ -714,16 +719,16 @@ void KEBListView::readonlyFlagInit(bool readonly) {
void KEBListView::slotMoved()
{ ListView::self()->handleMoved(this); }
void KEBListView::slotContextMenu(KListView *a, QListViewItem *b, const QPoint &c)
void KEBListView::slotContextMenu(KListView *a, Q3ListViewItem *b, const QPoint &c)
{ ListView::self()->handleContextMenu(this, a,b,c); }
void KEBListView::slotItemRenamed(QListViewItem *a, const QString &b, int c)
void KEBListView::slotItemRenamed(Q3ListViewItem *a, const QString &b, int c)
{ ListView::self()->handleItemRenamed(this, a,b,c); }
void KEBListView::slotDoubleClicked(QListViewItem *a, const QPoint &b, int c)
void KEBListView::slotDoubleClicked(Q3ListViewItem *a, const QPoint &b, int c)
{ ListView::self()->handleDoubleClicked(this, a,b,c); }
void KEBListView::slotDropped(QDropEvent *a, QListViewItem *b, QListViewItem *c)
void KEBListView::slotDropped(QDropEvent *a, Q3ListViewItem *b, Q3ListViewItem *c)
{ ListView::self()->handleDropped(this, a,b,c); }
void KEBListView::rename(QListViewItem *qitem, int column) {
void KEBListView::rename(Q3ListViewItem *qitem, int column) {
KEBListViewItem *item = static_cast<KEBListViewItem *>(qitem);
if ( !(column == NameColumn || column == UrlColumn || column == CommentColumn)
|| KEBApp::self()->readonly()
@ -747,7 +752,7 @@ KEBListViewItem* KEBListView::rootItem() const {
// Update display of bookmarks containing URL
void KEBListView::updateByURL(QString url) {
for (QListViewItemIterator it(this); it.current(); it++) {
for (Q3ListViewItemIterator it(this); it.current(); it++) {
KEBListViewItem *p = static_cast<KEBListViewItem *>(it.current());
if (p->text(1) == url) {
p->modUpdate();
@ -759,8 +764,8 @@ bool KEBListView::acceptDrag(QDropEvent * e) const {
return (e->source() == viewport() || KBookmarkDrag::canDecode(e));
}
QDragObject *KEBListView::dragObject() {
QValueList<KBookmark> bookmarks =
Q3DragObject *KEBListView::dragObject() {
Q3ValueList<KBookmark> bookmarks =
ListView::self()->itemsToBookmarks(ListView::self()->selectedItemsMap());
KBookmarkDrag *drag = KBookmarkDrag::newDrag(bookmarks, viewport());
const QString iconname =
@ -771,10 +776,10 @@ QDragObject *KEBListView::dragObject() {
/* -------------------------------------- */
bool KEBListViewItem::parentSelected(QListViewItem * item)
bool KEBListViewItem::parentSelected(Q3ListViewItem * item)
{
QListViewItem *root = item->listView()->firstChild();
for( QListViewItem *parent = item->parent(); parent ; parent = parent->parent())
Q3ListViewItem *root = item->listView()->firstChild();
for( Q3ListViewItem *parent = item->parent(); parent ; parent = parent->parent())
if (parent->isSelected() && parent != root)
return true;
return false;
@ -791,14 +796,14 @@ void KEBListViewItem::setSelected(bool s)
if(listView()->firstChild() == this)
{
ListView::self()->selected(this, s);
QListViewItem::setSelected( s );
Q3ListViewItem::setSelected( s );
return;
}
if(s == false)
{
ListView::self()->selected(this, false);
QListViewItem::setSelected( false );
Q3ListViewItem::setSelected( false );
ListView::deselectAllChildren( this ); //repaints
}
else if(parentSelected(this))
@ -806,7 +811,7 @@ void KEBListViewItem::setSelected(bool s)
else
{
ListView::self()->selected(this, true);
QListViewItem::setSelected( true );
Q3ListViewItem::setSelected( true );
ListView::deselectAllChildren(this);
}
}
@ -815,7 +820,7 @@ void KEBListViewItem::normalConstruct(const KBookmark &bk) {
#ifdef DEBUG_ADDRESSES
setText(KEBListView::AddressColumn, bk.address());
#endif
setText(KEBListView::CommentColumn, NodeEditCommand::getNodeText(bk, "desc"));
setText(KEBListView::CommentColumn, NodeEditCommand::getNodeText(bk, QStringList() << "desc"));
bool shown = CmdGen::shownInToolbar(bk);
setPixmap(0, SmallIcon(shown ? QString("bookmark_toolbar") : bk.icon()));
// DESIGN - modUpdate badly needs a redesign
@ -825,8 +830,8 @@ void KEBListViewItem::normalConstruct(const KBookmark &bk) {
// DESIGN - following constructors should be names classes or else just explicit
// toplevel item (there should be only one!)
KEBListViewItem::KEBListViewItem(QListView *parent, const KBookmarkGroup &gp)
: QListViewItem(parent, KEBApp::self()->caption().isNull()
KEBListViewItem::KEBListViewItem(Q3ListView *parent, const KBookmarkGroup &gp)
: Q3ListViewItem(parent, KEBApp::self()->caption().isNull()
? i18n("Bookmarks")
: i18n("%1 Bookmarks").arg(KEBApp::self()->caption())),
m_bookmark(gp), m_emptyFolderPadder(false) {
@ -836,39 +841,39 @@ KEBListViewItem::KEBListViewItem(QListView *parent, const KBookmarkGroup &gp)
}
// empty folder item
KEBListViewItem::KEBListViewItem(KEBListViewItem *parent, QListViewItem *after)
: QListViewItem(parent, after, i18n("Empty Folder") ), m_emptyFolderPadder(true) {
KEBListViewItem::KEBListViewItem(KEBListViewItem *parent, Q3ListViewItem *after)
: Q3ListViewItem(parent, after, i18n("Empty Folder") ), m_emptyFolderPadder(true) {
setPixmap(0, SmallIcon("bookmark"));
}
// group
KEBListViewItem::KEBListViewItem(KEBListViewItem *parent, QListViewItem *after, const KBookmarkGroup &gp)
: QListViewItem(parent, after, gp.fullText()), m_bookmark(gp), m_emptyFolderPadder(false) {
KEBListViewItem::KEBListViewItem(KEBListViewItem *parent, Q3ListViewItem *after, const KBookmarkGroup &gp)
: Q3ListViewItem(parent, after, gp.fullText()), m_bookmark(gp), m_emptyFolderPadder(false) {
setExpandable(true);
normalConstruct(gp);
}
// bookmark (first of its group)
KEBListViewItem::KEBListViewItem(KEBListViewItem *parent, const KBookmark & bk)
: QListViewItem(parent, bk.fullText(), bk.url().pathOrURL()), m_bookmark(bk), m_emptyFolderPadder(false) {
: Q3ListViewItem(parent, bk.fullText(), bk.url().pathOrURL()), m_bookmark(bk), m_emptyFolderPadder(false) {
normalConstruct(bk);
}
// bookmark (after another)
KEBListViewItem::KEBListViewItem(KEBListViewItem *parent, QListViewItem *after, const KBookmark &bk)
: QListViewItem(parent, after, bk.fullText(), bk.url().pathOrURL()), m_bookmark(bk), m_emptyFolderPadder(false) {
KEBListViewItem::KEBListViewItem(KEBListViewItem *parent, Q3ListViewItem *after, const KBookmark &bk)
: Q3ListViewItem(parent, after, bk.fullText(), bk.url().pathOrURL()), m_bookmark(bk), m_emptyFolderPadder(false) {
normalConstruct(bk);
}
// root bookmark (first of its group)
KEBListViewItem::KEBListViewItem(QListView *parent, const KBookmark & bk)
: QListViewItem(parent, bk.fullText(), bk.url().pathOrURL()), m_bookmark(bk), m_emptyFolderPadder(false) {
KEBListViewItem::KEBListViewItem(Q3ListView *parent, const KBookmark & bk)
: Q3ListViewItem(parent, bk.fullText(), bk.url().pathOrURL()), m_bookmark(bk), m_emptyFolderPadder(false) {
normalConstruct(bk);
}
// root bookmark (after another)
KEBListViewItem::KEBListViewItem(QListView *parent, QListViewItem *after, const KBookmark &bk)
: QListViewItem(parent, after, bk.fullText(), bk.url().pathOrURL()), m_bookmark(bk), m_emptyFolderPadder(false) {
KEBListViewItem::KEBListViewItem(Q3ListView *parent, Q3ListViewItem *after, const KBookmark &bk)
: Q3ListViewItem(parent, after, bk.fullText(), bk.url().pathOrURL()), m_bookmark(bk), m_emptyFolderPadder(false) {
normalConstruct(bk);
}
@ -877,7 +882,7 @@ void KEBListViewItem::setOpen(bool open) {
if (!parent())
return;
m_bookmark.internalElement().setAttribute("folded", open ? "no" : "yes");
QListViewItem::setOpen(open);
Q3ListViewItem::setOpen(open);
}
void KEBListViewItem::greyStyle(QColorGroup &cg) {
@ -932,7 +937,7 @@ void KEBListViewItem::paintCell(QPainter *p, const QColorGroup &ocg, int col, in
}
}
QListViewItem::paintCell(p, cg, col, w,a);
Q3ListViewItem::paintCell(p, cg, col, w,a);
}
#include "listview.moc"

View file

@ -22,8 +22,12 @@
#include <assert.h>
#include <qlistview.h>
#include <qmap.h>
#include <q3listview.h>
//Added by qt3to4:
#include <Q3ValueList>
#include <QDropEvent>
#include <Q3PtrList>
#include <QMap>
#include <klocale.h>
#include <kbookmark.h>
@ -35,17 +39,17 @@
class QSplitter;
class KListViewSearchLine;
class KEBListViewItem : public QListViewItem
class KEBListViewItem : public Q3ListViewItem
{
public:
KEBListViewItem(QListView *, const KBookmarkGroup &);
KEBListViewItem(KEBListViewItem *, QListViewItem *);
KEBListViewItem(KEBListViewItem *, QListViewItem *, const KBookmarkGroup &);
KEBListViewItem(Q3ListView *, const KBookmarkGroup &);
KEBListViewItem(KEBListViewItem *, Q3ListViewItem *);
KEBListViewItem(KEBListViewItem *, Q3ListViewItem *, const KBookmarkGroup &);
KEBListViewItem(KEBListViewItem *, const KBookmark &);
KEBListViewItem(KEBListViewItem *, QListViewItem *, const KBookmark &);
KEBListViewItem(KEBListViewItem *, Q3ListViewItem *, const KBookmark &);
KEBListViewItem(QListView *, const KBookmark &);
KEBListViewItem(QListView *, QListViewItem *, const KBookmark &);
KEBListViewItem(Q3ListView *, const KBookmark &);
KEBListViewItem(Q3ListView *, Q3ListViewItem *, const KBookmark &);
void nsPut(const QString &nm);
@ -65,7 +69,7 @@ public:
typedef enum { GreyStyle, BoldStyle, GreyBoldStyle, DefaultStyle } PaintStyle;
static bool parentSelected(QListViewItem * item);
static bool parentSelected(Q3ListViewItem * item);
private:
const QString nsGet() const;
@ -108,17 +112,17 @@ public:
KEBListViewItem* rootItem() const;
public slots:
virtual void rename(QListViewItem *item, int c);
virtual void rename(Q3ListViewItem *item, int c);
void slotMoved();
void slotContextMenu(KListView *, QListViewItem *, const QPoint &);
void slotItemRenamed(QListViewItem *, const QString &, int);
void slotDoubleClicked(QListViewItem *, const QPoint &, int);
void slotDropped(QDropEvent*, QListViewItem*, QListViewItem*);
void slotContextMenu(KListView *, Q3ListViewItem *, const QPoint &);
void slotItemRenamed(Q3ListViewItem *, const QString &, int);
void slotDoubleClicked(Q3ListViewItem *, const QPoint &, int);
void slotDropped(QDropEvent*, Q3ListViewItem*, Q3ListViewItem*);
void slotColumnSizeChanged(int, int, int);
protected:
virtual bool acceptDrag(QDropEvent *e) const;
virtual QDragObject* dragObject();
virtual Q3DragObject* dragObject();
private:
bool m_folderList;
@ -140,20 +144,20 @@ public:
void selected(KEBListViewItem * item, bool s);
void invalidate(const QString & address);
void invalidate(QListViewItem * item);
void invalidate(Q3ListViewItem * item);
void fixUpCurrent(const QString & address);
KEBListViewItem * firstSelected() const;
QMap<KEBListViewItem *, bool> selectedItemsMap() const
{ return mSelectedItems; }
QValueList<QString> selectedAddresses();
Q3ValueList<QString> selectedAddresses();
// bookmark helpers
QValueList<KBookmark> itemsToBookmarks(const QMap<KEBListViewItem *, bool> & items) const;
Q3ValueList<KBookmark> itemsToBookmarks(const QMap<KEBListViewItem *, bool> & items) const;
// bookmark stuff
QValueList<KBookmark> allBookmarks() const;
QValueList<KBookmark> selectedBookmarksExpanded() const;
Q3ValueList<KBookmark> allBookmarks() const;
Q3ValueList<KBookmark> selectedBookmarksExpanded() const;
// address stuff
KEBListViewItem* getItemAtAddress(const QString &address) const;
@ -177,10 +181,10 @@ public:
static void createListViews(QSplitter *parent);
void handleMoved(KEBListView *);
void handleDropped(KEBListView *, QDropEvent *, QListViewItem *, QListViewItem *);
void handleContextMenu(KEBListView *, KListView *, QListViewItem *, const QPoint &);
void handleDoubleClicked(KEBListView *, QListViewItem *, const QPoint &, int);
void handleItemRenamed(KEBListView *, QListViewItem *, const QString &, int);
void handleDropped(KEBListView *, QDropEvent *, Q3ListViewItem *, Q3ListViewItem *);
void handleContextMenu(KEBListView *, KListView *, Q3ListViewItem *, const QPoint &);
void handleDoubleClicked(KEBListView *, Q3ListViewItem *, const QPoint &, int);
void handleItemRenamed(KEBListView *, Q3ListViewItem *, const QString &, int);
static void startRename(int column, KEBListViewItem *item);
@ -193,7 +197,7 @@ public slots:
private:
void updateTree();
void selectedBookmarksExpandedHelper(KEBListViewItem * item, QValueList<KBookmark> & bookmarks) const;
void selectedBookmarksExpandedHelper(KEBListViewItem * item, Q3ValueList<KBookmark> & bookmarks) const;
void fillWithGroup(KEBListView *, KBookmarkGroup, KEBListViewItem * = 0);
ListView();

View file

@ -39,6 +39,8 @@
#include <kbookmarkmanager.h>
#include <kbookmarkexporter.h>
//Added by qt3to4:
#include <Q3CString>
static KCmdLineOptions options[] = {
{"importmoz <filename>", I18N_NOOP("Import bookmarks from a file in Mozilla format"), 0},
@ -60,12 +62,12 @@ static KCmdLineOptions options[] = {
};
static void continueInWindow(QString _wname) {
QCString wname = _wname.latin1();
Q3CString wname = _wname.latin1();
int id = -1;
QCStringList apps = kapp->dcopClient()->registeredApplications();
for (QCStringList::Iterator it = apps.begin(); it != apps.end(); ++it) {
QCString &clientId = *it;
DCOPCStringList apps = kapp->dcopClient()->registeredApplications();
for (DCOPCStringList::Iterator it = apps.begin(); it != apps.end(); ++it) {
DCOPCString &clientId = *it;
if (qstrncmp(clientId, wname, wname.length()) != 0)
continue;
@ -84,7 +86,7 @@ static void continueInWindow(QString _wname) {
// TODO - make this register() or something like that and move dialog into main
static int askUser(KApplication &app, QString filename, bool &readonly) {
QCString requestedName("keditbookmarks");
DCOPCString requestedName("keditbookmarks");
if (!filename.isEmpty())
requestedName += "-" + filename.utf8();

View file

@ -65,7 +65,7 @@ void TestLinkItrHolder::addAffectedBookmark( const QString & address )
/* -------------------------- */
TestLinkItr::TestLinkItr(QValueList<KBookmark> bks)
TestLinkItr::TestLinkItr(Q3ValueList<KBookmark> bks)
: BookmarkIterator(bks) {
m_job = 0;
}

View file

@ -21,6 +21,8 @@
#define __testlink_h
#include <qobject.h>
//Added by qt3to4:
#include <Q3ValueList>
#include <kio/job.h>
#include <kbookmark.h>
@ -56,7 +58,7 @@ class TestLinkItr : public BookmarkIterator
Q_OBJECT
public:
TestLinkItr(QValueList<KBookmark> bks);
TestLinkItr(Q3ValueList<KBookmark> bks);
~TestLinkItr();
virtual TestLinkItrHolder* holder() const { return TestLinkItrHolder::self(); }

View file

@ -36,6 +36,8 @@
#include <qsplitter.h>
#include <qlayout.h>
#include <qlabel.h>
//Added by qt3to4:
#include <Q3ValueList>
#include <klocale.h>
#include <kdebug.h>
@ -230,8 +232,8 @@ KEBApp::KEBApp(
m_bkinfo = new BookmarkInfoWidget(vsplitter);
vsplitter->setOrientation(QSplitter::Vertical);
vsplitter->setSizes(QValueList<int>() << h << 380
vsplitter->setOrientation(Qt::Vertical);
vsplitter->setSizes(Q3ValueList<int>() << h << 380
<< m_bkinfo->sizeHint().height() );
setCentralWidget(vsplitter);

View file

@ -5,6 +5,10 @@
***********************************************************************/
#include <qtimer.h>
//Added by qt3to4:
#include <QMouseEvent>
#include <QKeyEvent>
#include <QEvent>
#include <kglobal.h>
#include <klocale.h>
@ -84,7 +88,7 @@ void KDateCombo::dateEnteredEvent(QDate newDate)
void KDateCombo::mousePressEvent (QMouseEvent * e)
{
if (e->button() & QMouseEvent::LeftButton)
if (e->button() & Qt::LeftButton)
{
if (rect().contains( e->pos()))
{

View file

@ -27,7 +27,7 @@
#include <kpushbutton.h>
#include <qlayout.h>
#include <qvbox.h>
#include <q3vbox.h>
#include <kdialog.h>
#include <kdebug.h>
@ -64,7 +64,7 @@ Kfind::Kfind(QWidget *parent, const char *name)
*/
// create button box
QVBox * mButtonBox = new QVBox( this );
Q3VBox * mButtonBox = new Q3VBox( this );
QVBoxLayout *lay = (QVBoxLayout*)mButtonBox->layout();
lay->addStretch(1);
mTopLayout->addWidget(mButtonBox);

View file

@ -31,7 +31,7 @@ KfindDlg::KfindDlg(const KURL & url, QWidget *parent, const char *name)
KStdGuiItem::saveAs())
{
QWidget::setCaption( i18n("Find Files/Folders" ) );
setButtonBoxOrientation(Vertical);
setButtonBoxOrientation(Qt::Vertical);
enableButton(Apply, true); // Enable "Find"
enableButton(User1, false); // Disable "Stop"
@ -53,9 +53,9 @@ KfindDlg::KfindDlg(const KURL & url, QWidget *parent, const char *name)
mStatusBar = new KStatusBar(frame);
mStatusBar->insertFixedItem(i18n("AMiddleLengthText..."), 0, true);
setStatusMsg(i18n("Ready."));
mStatusBar->setItemAlignment(0, AlignLeft | AlignVCenter);
mStatusBar->setItemAlignment(0, Qt::AlignLeft | Qt::AlignVCenter);
mStatusBar->insertItem(QString::null, 1, 1, true);
mStatusBar->setItemAlignment(1, AlignLeft | AlignVCenter);
mStatusBar->setItemAlignment(1, Qt::AlignLeft | Qt::AlignVCenter);
QVBoxLayout *vBox = new QVBoxLayout(frame);
vBox->addWidget(tabWidget, 0);
@ -236,7 +236,7 @@ void KfindDlg::about ()
void KfindDlg::slotDeleteItem(const QString& file)
{
kdDebug()<<QString("Will remove one item: %1").arg(file)<<endl;
QListViewItem *iter;
Q3ListViewItem *iter;
QString iterwithpath;
iter=win->firstChild();
@ -256,7 +256,7 @@ void KfindDlg::slotNewItems( const QString& file )
{
kdDebug()<<QString("Will add this item")<<endl;
QStringList newfiles;
QListViewItem *checkiter;
Q3ListViewItem *checkiter;
QString checkiterwithpath;
if(file.find(query->url().path(+1))==0)

View file

@ -24,7 +24,7 @@
#include <kparts/part.h>
#include <kfileitem.h>
#include <kdebug.h>
#include <qptrlist.h>
#include <q3ptrlist.h>
#include <konq_dirpart.h>
class KQuery;
@ -98,7 +98,7 @@ private:
/**
* The internal storage of file items
*/
QPtrList<KFileItem> m_lstFileItems;
Q3PtrList<KFileItem> m_lstFileItems;
};
#endif

View file

@ -35,11 +35,11 @@ static void save_pattern(QComboBox *, const QString &, const QString &);
#define SPECIAL_TYPES 7
class KSortedMimeTypeList : public QPtrList<KMimeType>
class KSortedMimeTypeList : public Q3PtrList<KMimeType>
{
public:
KSortedMimeTypeList() { };
int compareItems(QPtrCollection::Item s1, QPtrCollection::Item s2)
int compareItems(Q3PtrCollection::Item s1, Q3PtrCollection::Item s2)
{
KMimeType *item1 = (KMimeType *) s1;
KMimeType *item2 = (KMimeType *) s2;
@ -76,7 +76,7 @@ KfindTabWidget::KfindTabWidget(QWidget *parent, const char *name)
subdirsCb->setChecked(true);
caseSensCb->setChecked(false);
useLocateCb->setChecked(false);
if(KStandardDirs::findExe("locate")==NULL)
if(KStandardDirs::findExe("locate").isEmpty())
useLocateCb->setEnabled(false);
nameBox->setDuplicatesEnabled(FALSE);
@ -211,7 +211,7 @@ KfindTabWidget::KfindTabWidget(QWidget *parent, const char *name)
grid1->addWidget(rb[0], 1, 1 );
grid1->addWidget(fromDate, 1, 2 );
grid1->addWidget(andL, 1, 3, AlignHCenter );
grid1->addWidget(andL, 1, 3, Qt::AlignHCenter );
grid1->addWidget(toDate, 1, 4 );
grid1->addWidget(rb[1], 2, 1 );
@ -235,7 +235,7 @@ KfindTabWidget::KfindTabWidget(QWidget *parent, const char *name)
// Connect
connect( findCreated, SIGNAL(toggled(bool)), SLOT(fixLayout()) );
connect( bg, SIGNAL(clicked(int)), this, SLOT(fixLayout()) );
connect( bg, SIGNAL(buttonClicked(QAbstractButton*)), this, SLOT(fixLayout()) );
connect( sizeBox, SIGNAL(highlighted(int)), this, SLOT(slotSizeBoxChanged(int)));
@ -329,7 +329,7 @@ KfindTabWidget::KfindTabWidget(QWidget *parent, const char *name)
grid2->addWidget( textMetaKey, 4, 0 );
grid2->addWidget( metainfokeyEdit, 4, 1 );
grid2->addWidget( textMetaInfo, 4, 2, AlignHCenter );
grid2->addWidget( textMetaInfo, 4, 2, Qt::AlignHCenter );
grid2->addWidget( metainfoEdit, 4, 3 );
metainfokeyEdit->setText("*");
@ -497,7 +497,7 @@ void KfindTabWidget::slotEditRegExp()
if ( ! regExpDialog )
regExpDialog = KParts::ComponentFactory::createInstanceFromQuery<QDialog>( "KRegExpEditor/KRegExpEditor", QString::null, this );
KRegExpEditorInterface *iface = static_cast<KRegExpEditorInterface *>( regExpDialog->qt_cast( "KRegExpEditorInterface" ) );
KRegExpEditorInterface *iface = dynamic_cast<KRegExpEditorInterface *>( regExpDialog );
if ( !iface )
return;
@ -652,8 +652,8 @@ void KfindTabWidget::setQuery(KQuery *query)
toDate->getDate(&q2);
// do not generate negative numbers .. find doesn't handle that
time_t time1 = epoch.secsTo(q1);
time_t time2 = epoch.secsTo(q2.addDays(1)) - 1; // Include the last day
time_t time1 = epoch.secsTo(QDateTime(q1));
time_t time2 = epoch.secsTo(QDateTime(q2.addDays(1))) - 1; // Include the last day
query->setTimeRange(time1, time2);
}
@ -708,12 +708,12 @@ void KfindTabWidget::setQuery(KQuery *query)
query->setMimeType( m_AudioTypes );
break;
default:
query->setMimeType( m_types[id]->name() );
query->setMimeType( QStringList() += m_types[id]->name() );
}
}
else
{
query->setMimeType( QString::null );
query->setMimeType( QStringList() );
}
//Metainfo

View file

@ -19,7 +19,7 @@
#include <qdir.h>
#include <qclipboard.h>
#include <qpixmap.h>
#include <qdragobject.h>
#include <q3dragobject.h>
#include <kfiledialog.h>
#include <klocale.h>
@ -34,7 +34,7 @@
#include <kpopupmenu.h>
#include <kio/netaccess.h>
#include <kurldrag.h>
#include <qptrlist.h>
#include <q3ptrlist.h>
#include <kdebug.h>
#include <kiconloader.h>
@ -42,7 +42,7 @@
#include "kfwin.moc"
template class QPtrList<KfFileLVI>;
template class Q3PtrList<KfFileLVI>;
// Permission strings
static const char* perm[4] = {
@ -56,7 +56,7 @@ static const char* perm[4] = {
#define NA 3
KfFileLVI::KfFileLVI(KfindWindow* lv, const KFileItem &item, const QString& matchingLine)
: QListViewItem(lv),
: Q3ListViewItem(lv),
fileitem(item)
{
fileInfo = new QFileInfo(item.url().path());
@ -109,20 +109,20 @@ KfindWindow::KfindWindow( QWidget *parent, const char *name )
,m_baseDir("")
,m_menu(0)
{
setSelectionMode( QListView::Extended );
setSelectionMode( Q3ListView::Extended );
setShowSortIndicator( TRUE );
addColumn(i18n("Name"));
addColumn(i18n("In Subfolder"));
addColumn(i18n("Size"));
setColumnAlignment(2, AlignRight);
setColumnAlignment(2, Qt::AlignRight);
addColumn(i18n("Modified"));
setColumnAlignment(3, AlignRight);
setColumnAlignment(3, Qt::AlignRight);
addColumn(i18n("Permissions"));
setColumnAlignment(4, AlignRight);
setColumnAlignment(4, Qt::AlignRight);
addColumn(i18n("First Matching Line"));
setColumnAlignment(5, AlignLeft);
setColumnAlignment(5, Qt::AlignLeft);
// Disable autoresize for all columns
// Resizing is done by resetColumns() function
@ -134,11 +134,11 @@ KfindWindow::KfindWindow( QWidget *parent, const char *name )
connect( this, SIGNAL(selectionChanged()),
this, SLOT( selectionHasChanged() ));
connect(this, SIGNAL(contextMenu(KListView *, QListViewItem*,const QPoint&)),
this, SLOT(slotContextMenu(KListView *,QListViewItem*,const QPoint&)));
connect(this, SIGNAL(contextMenu(KListView *, Q3ListViewItem*,const QPoint&)),
this, SLOT(slotContextMenu(KListView *,Q3ListViewItem*,const QPoint&)));
connect(this, SIGNAL(executed(QListViewItem*)),
this, SLOT(slotExecute(QListViewItem*)));
connect(this, SIGNAL(executed(Q3ListViewItem*)),
this, SLOT(slotExecute(Q3ListViewItem*)));
setDragEnabled(true);
}
@ -174,7 +174,7 @@ void KfindWindow::insertItem(const KFileItem &item, const QString& matchingLine)
// copy to clipboard aka X11 selection
void KfindWindow::copySelection()
{
QDragObject *drag_obj = dragObject();
Q3DragObject *drag_obj = dragObject();
if (drag_obj)
{
@ -185,7 +185,7 @@ void KfindWindow::copySelection()
void KfindWindow::saveResults()
{
QListViewItem *item;
Q3ListViewItem *item;
KFileDialog *dlg = new KFileDialog(QString::null, QString::null, this,
"filedialog", true);
@ -267,7 +267,7 @@ void KfindWindow::selectionHasChanged()
{
emit resultSelected(true);
QListViewItem *item = firstChild();
Q3ListViewItem *item = firstChild();
while(item != 0L)
{
if(isSelected(item)) {
@ -291,7 +291,7 @@ void KfindWindow::deleteFiles()
return;
// Iterate on all selected elements
QPtrList<QListViewItem> selected = selectedItems();
Q3PtrList<Q3ListViewItem> selected = selectedItems();
for ( uint i = 0; i < selected.count(); i++ ) {
KfFileLVI *item = (KfFileLVI *) selected.at(i);
KFileItem file = item->fileitem;
@ -323,7 +323,7 @@ void KfindWindow::openBinding()
((KfFileLVI*)currentItem())->fileitem.run();
}
void KfindWindow::slotExecute(QListViewItem* item)
void KfindWindow::slotExecute(Q3ListViewItem* item)
{
if (item==0)
return;
@ -338,10 +338,10 @@ void KfindWindow::resizeEvent(QResizeEvent *e)
clipper()->repaint();
}
QDragObject * KfindWindow::dragObject()
Q3DragObject * KfindWindow::dragObject()
{
KURL::List uris;
QPtrList<QListViewItem> selected = selectedItems();
Q3PtrList<Q3ListViewItem> selected = selectedItems();
// create a list of URIs from selection
for ( uint i = 0; i < selected.count(); i++ )
@ -356,7 +356,7 @@ QDragObject * KfindWindow::dragObject()
if ( uris.count() <= 0 )
return 0;
QUriDrag *ud = new KURLDrag( uris, (QWidget *) this, "kfind uridrag" );
Q3UriDrag *ud = new KURLDrag( uris, (QWidget *) this, "kfind uridrag" );
const QPixmap *pix = currentItem()->pixmap(0);
if ( pix && !pix->isNull() )
@ -390,7 +390,7 @@ void KfindWindow::resetColumns(bool init)
setColumnWidth(1, dir_w);
}
void KfindWindow::slotContextMenu(KListView *,QListViewItem *item,const QPoint&p)
void KfindWindow::slotContextMenu(KListView *,Q3ListViewItem *item,const QPoint&p)
{
if (!item) return;
int count = selectedItems().count();

View file

@ -17,7 +17,7 @@ class QFileInfo;
class KPopupMenu;
class KfindWindow;
class KfFileLVI : public QListViewItem
class KfFileLVI : public Q3ListViewItem
{
public:
KfFileLVI(KfindWindow* lv, const KFileItem &item,const QString& matchingLine);
@ -44,7 +44,7 @@ public:
public slots:
void copySelection();
void slotContextMenu(KListView *,QListViewItem *item,const QPoint&p);
void slotContextMenu(KListView *,Q3ListViewItem *item,const QPoint&p);
private slots:
void deleteFiles();
@ -53,13 +53,13 @@ private slots:
void saveResults();
void openBinding();
void selectionHasChanged();
void slotExecute(QListViewItem*);
void slotExecute(Q3ListViewItem*);
void slotOpenWith();
protected:
virtual void resizeEvent(QResizeEvent *e);
virtual QDragObject *dragObject();
virtual Q3DragObject *dragObject();
signals:
void resultSelected(bool);

View file

@ -1,6 +1,8 @@
#include <stdlib.h>
#include <qfileinfo.h>
#include <qtextstream.h>
#include <kdebug.h>
#include <kfileitem.h>
#include <kfilemetainfo.h>

View file

@ -5,7 +5,7 @@
#include <qobject.h>
#include <qregexp.h>
#include <qptrqueue.h>
#include <q3ptrqueue.h>
#include <qdir.h>
#include <qstringlist.h>
@ -31,10 +31,10 @@ class KQuery : public QObject
void setFileType( int filetype );
void setMimeType( const QStringList & mimetype );
void setContext( const QString & context, bool casesensitive,
bool search_binary, bool useRegexp );
bool search_binary, bool useRegexp );
void setUsername( QString username );
void setGroupname( QString groupname );
void setMetaInfo(const QString &metainfo, const QString &metainfokey);
void setMetaInfo(const QString &metainfo, const QString &metainfokey);
void setUseFileIndex(bool);
void start();
@ -86,11 +86,11 @@ class KQuery : public QObject
int bufferLocateLength;
QStringList locateList;
KProcess *processLocate;
QPtrList<QRegExp> m_regexps;// regexps for file name
Q3PtrList<QRegExp> m_regexps;// regexps for file name
// QValueList<bool> m_regexpsContainsGlobs; // what should this be good for ? Alex
KIO::ListJob *job;
bool m_insideCheckEntries;
QPtrQueue<KFileItem> m_fileItems;
Q3PtrQueue<KFileItem> m_fileItems;
QRegExp* metaKeyRx;
int m_result;
QStringList ignore_mimetypes;

View file

@ -29,6 +29,9 @@
#include <kdcoppropertyproxy.h>
#include <kdebug.h>
#include <kwin.h>
//Added by qt3to4:
#include <Q3ValueList>
#include <Q3CString>
KonqMainWindowIface::KonqMainWindowIface( KonqMainWindow * mainWindow )
:
@ -91,34 +94,34 @@ DCOPRef KonqMainWindowIface::currentPart()
return view->dcopObject()->part();
}
DCOPRef KonqMainWindowIface::action( const QCString &name )
DCOPRef KonqMainWindowIface::action( const DCOPCString &name )
{
return DCOPRef( kapp->dcopClient()->appId(), m_dcopActionProxy->actionObjectId( name ) );
}
QCStringList KonqMainWindowIface::actions()
DCOPCStringList KonqMainWindowIface::actions()
{
QCStringList res;
QValueList<KAction *> lst = m_dcopActionProxy->actions();
QValueList<KAction *>::ConstIterator it = lst.begin();
QValueList<KAction *>::ConstIterator end = lst.end();
DCOPCStringList res;
Q3ValueList<KAction *> lst = m_dcopActionProxy->actions();
Q3ValueList<KAction *>::ConstIterator it = lst.begin();
Q3ValueList<KAction *>::ConstIterator end = lst.end();
for (; it != end; ++it )
res.append( (*it)->name() );
return res;
}
QMap<QCString,DCOPRef> KonqMainWindowIface::actionMap()
QMap<DCOPCString,DCOPRef> KonqMainWindowIface::actionMap()
{
return m_dcopActionProxy->actionMap();
}
QCStringList KonqMainWindowIface::functionsDynamic()
DCOPCStringList KonqMainWindowIface::functionsDynamic()
{
return DCOPObject::functionsDynamic() + KDCOPPropertyProxy::functions( m_pMainWindow );
}
bool KonqMainWindowIface::processDynamic( const QCString &fun, const QByteArray &data, QCString &replyType, QByteArray &replyData )
bool KonqMainWindowIface::processDynamic( const DCOPCString &fun, const QByteArray &data, DCOPCString &replyType, QByteArray &replyData )
{
if ( KDCOPPropertyProxy::isPropertyRequest( fun, m_pMainWindow ) )
return KDCOPPropertyProxy::processPropertyRequest( fun, data, replyType, replyData, m_pMainWindow );

View file

@ -22,7 +22,9 @@
#define __KonqMainWindowIface_h__
#include <dcopobject.h>
#include <qvaluelist.h>
#include <q3valuelist.h>
//Added by qt3to4:
#include <Q3CString>
#include <dcopref.h>
#include <kmainwindowiface.h>
@ -62,9 +64,9 @@ k_dcop:
*/
DCOPRef currentPart();
DCOPRef action( const QCString &name );
QCStringList actions();
QMap<QCString,DCOPRef> actionMap();
DCOPRef action( const DCOPCString &name );
DCOPCStringList actions();
QMap<DCOPCString,DCOPRef> actionMap();
/**
* Used by kfmclient when searching a window to open a tab within
@ -72,8 +74,8 @@ k_dcop:
bool windowCanBeUsedForTab();
public:
virtual QCStringList functionsDynamic();
virtual bool processDynamic( const QCString &fun, const QByteArray &data, QCString &replyType, QByteArray &replyData );
virtual DCOPCStringList functionsDynamic();
virtual bool processDynamic( const DCOPCString &fun, const QByteArray &data, DCOPCString &replyType, QByteArray &replyData );
private:

View file

@ -29,6 +29,11 @@
#include <dcopclient.h>
#include <kdebug.h>
#include <qfile.h>
//Added by qt3to4:
#include <QX11Info>
#include <Q3ValueList>
#include <Q3CString>
#include <Q3PtrList>
#include "konq_settingsxt.h"
// these DCOP calls come from outside, so any windows created by these
@ -39,7 +44,6 @@
// TODO a valid timestamp should be passed in the DCOP calls that
// are not for user scripting
#include <X11/Xlib.h>
extern Time qt_x_user_time;
KonquerorIface::KonquerorIface()
: DCOPObject( "KonquerorIface" )
@ -52,14 +56,14 @@ KonquerorIface::~KonquerorIface()
DCOPRef KonquerorIface::openBrowserWindow( const QString &url )
{
qt_x_user_time = 0;
QX11Info::setAppUserTime( 0 );
KonqMainWindow *res = KonqMisc::createSimpleWindow( KURL(url) );
if ( !res )
return DCOPRef();
return res->dcopObject();
}
DCOPRef KonquerorIface::openBrowserWindowASN( const QString &url, const QCString& startup_id )
DCOPRef KonquerorIface::openBrowserWindowASN( const QString &url, const DCOPCString& startup_id )
{
kapp->setStartupId( startup_id );
return openBrowserWindow( url );
@ -70,7 +74,7 @@ DCOPRef KonquerorIface::createNewWindow( const QString &url )
return createNewWindow( url, QString::null, false );
}
DCOPRef KonquerorIface::createNewWindowASN( const QString &url, const QCString& startup_id, bool tempFile )
DCOPRef KonquerorIface::createNewWindowASN( const QString &url, const DCOPCString& startup_id, bool tempFile )
{
kapp->setStartupId( startup_id );
return createNewWindow( url, QString::null, tempFile );
@ -78,14 +82,14 @@ DCOPRef KonquerorIface::createNewWindowASN( const QString &url, const QCString&
DCOPRef KonquerorIface::createNewWindowWithSelection( const QString &url, QStringList filesToSelect )
{
qt_x_user_time = 0;
QX11Info::setAppUserTime( 0 );
KonqMainWindow *res = KonqMisc::createNewWindow( KURL(url), KParts::URLArgs(), false, filesToSelect );
if ( !res )
return DCOPRef();
return res->dcopObject();
}
DCOPRef KonquerorIface::createNewWindowWithSelectionASN( const QString &url, QStringList filesToSelect, const QCString &startup_id )
DCOPRef KonquerorIface::createNewWindowWithSelectionASN( const QString &url, QStringList filesToSelect, const DCOPCString &startup_id )
{
kapp->setStartupId( startup_id );
return createNewWindowWithSelection( url, filesToSelect );
@ -93,7 +97,7 @@ DCOPRef KonquerorIface::createNewWindowWithSelectionASN( const QString &url, QSt
DCOPRef KonquerorIface::createNewWindow( const QString &url, const QString &mimetype, bool tempFile )
{
qt_x_user_time = 0;
QX11Info::setAppUserTime( 0 );
KParts::URLArgs args;
args.serviceType = mimetype;
// Filter the URL, so that "kfmclient openURL gg:foo" works also when konq is already running
@ -105,7 +109,7 @@ DCOPRef KonquerorIface::createNewWindow( const QString &url, const QString &mime
}
DCOPRef KonquerorIface::createNewWindowASN( const QString &url, const QString &mimetype,
const QCString& startup_id, bool tempFile )
const DCOPCString& startup_id, bool tempFile )
{
kapp->setStartupId( startup_id );
return createNewWindow( url, mimetype, tempFile );
@ -113,7 +117,7 @@ DCOPRef KonquerorIface::createNewWindowASN( const QString &url, const QString &m
DCOPRef KonquerorIface::createBrowserWindowFromProfile( const QString &path )
{
qt_x_user_time = 0;
QX11Info::setAppUserTime( 0 );
kdDebug(1202) << "void KonquerorIface::createBrowserWindowFromProfile( const QString &path ) " << endl;
kdDebug(1202) << path << endl;
KonqMainWindow *res = KonqMisc::createBrowserWindowFromProfile( path, QString::null );
@ -122,7 +126,7 @@ DCOPRef KonquerorIface::createBrowserWindowFromProfile( const QString &path )
return res->dcopObject();
}
DCOPRef KonquerorIface::createBrowserWindowFromProfileASN( const QString &path, const QCString& startup_id )
DCOPRef KonquerorIface::createBrowserWindowFromProfileASN( const QString &path, const DCOPCString& startup_id )
{
kapp->setStartupId( startup_id );
return createBrowserWindowFromProfile( path );
@ -130,7 +134,7 @@ DCOPRef KonquerorIface::createBrowserWindowFromProfileASN( const QString &path,
DCOPRef KonquerorIface::createBrowserWindowFromProfile( const QString & path, const QString &filename )
{
qt_x_user_time = 0;
QX11Info::setAppUserTime( 0 );
kdDebug(1202) << "void KonquerorIface::createBrowserWindowFromProfile( path, filename ) " << endl;
kdDebug(1202) << path << "," << filename << endl;
KonqMainWindow *res = KonqMisc::createBrowserWindowFromProfile( path, filename );
@ -140,7 +144,7 @@ DCOPRef KonquerorIface::createBrowserWindowFromProfile( const QString & path, co
}
DCOPRef KonquerorIface::createBrowserWindowFromProfileASN( const QString &path, const QString &filename,
const QCString& startup_id )
const DCOPCString& startup_id )
{
kapp->setStartupId( startup_id );
return createBrowserWindowFromProfile( path, filename );
@ -148,7 +152,7 @@ DCOPRef KonquerorIface::createBrowserWindowFromProfileASN( const QString &path,
DCOPRef KonquerorIface::createBrowserWindowFromProfileAndURL( const QString & path, const QString &filename, const QString &url )
{
qt_x_user_time = 0;
QX11Info::setAppUserTime( 0 );
KonqMainWindow *res = KonqMisc::createBrowserWindowFromProfile( path, filename, KURL(url) );
if ( !res )
return DCOPRef();
@ -156,7 +160,7 @@ DCOPRef KonquerorIface::createBrowserWindowFromProfileAndURL( const QString & pa
}
DCOPRef KonquerorIface::createBrowserWindowFromProfileAndURLASN( const QString & path, const QString &filename, const QString &url,
const QCString& startup_id )
const DCOPCString& startup_id )
{
kapp->setStartupId( startup_id );
return createBrowserWindowFromProfileAndURL( path, filename, url );
@ -164,7 +168,7 @@ DCOPRef KonquerorIface::createBrowserWindowFromProfileAndURLASN( const QString &
DCOPRef KonquerorIface::createBrowserWindowFromProfileAndURL( const QString &path, const QString &filename, const QString &url, const QString &mimetype )
{
qt_x_user_time = 0;
QX11Info::setAppUserTime( 0 );
KParts::URLArgs args;
args.serviceType = mimetype;
KonqMainWindow *res = KonqMisc::createBrowserWindowFromProfile( path, filename, KURL(url), args );
@ -174,7 +178,7 @@ DCOPRef KonquerorIface::createBrowserWindowFromProfileAndURL( const QString &pat
}
DCOPRef KonquerorIface::createBrowserWindowFromProfileAndURLASN( const QString & path, const QString &filename, const QString &url, const QString &mimetype,
const QCString& startup_id )
const DCOPCString& startup_id )
{
kapp->setStartupId( startup_id );
return createBrowserWindowFromProfileAndURL( path, filename, url, mimetype );
@ -186,10 +190,10 @@ void KonquerorIface::reparseConfiguration()
KGlobal::config()->reparseConfiguration();
KonqFMSettings::reparseConfiguration();
QPtrList<KonqMainWindow> *mainWindows = KonqMainWindow::mainWindowList();
Q3PtrList<KonqMainWindow> *mainWindows = KonqMainWindow::mainWindowList();
if ( mainWindows )
{
QPtrListIterator<KonqMainWindow> it( *mainWindows );
Q3PtrListIterator<KonqMainWindow> it( *mainWindows );
for (; it.current(); ++it )
it.current()->reparseConfiguration();
}
@ -197,11 +201,11 @@ void KonquerorIface::reparseConfiguration()
void KonquerorIface::updateProfileList()
{
QPtrList<KonqMainWindow> *mainWindows = KonqMainWindow::mainWindowList();
Q3PtrList<KonqMainWindow> *mainWindows = KonqMainWindow::mainWindowList();
if ( !mainWindows )
return;
QPtrListIterator<KonqMainWindow> it( *mainWindows );
Q3PtrListIterator<KonqMainWindow> it( *mainWindows );
for (; it.current(); ++it )
it.current()->viewManager()->profileListDirty( false );
}
@ -211,30 +215,30 @@ QString KonquerorIface::crashLogFile()
return KonqMainWindow::s_crashlog_file->name();
}
QValueList<DCOPRef> KonquerorIface::getWindows()
Q3ValueList<DCOPRef> KonquerorIface::getWindows()
{
QValueList<DCOPRef> lst;
QPtrList<KonqMainWindow> *mainWindows = KonqMainWindow::mainWindowList();
Q3ValueList<DCOPRef> lst;
Q3PtrList<KonqMainWindow> *mainWindows = KonqMainWindow::mainWindowList();
if ( mainWindows )
{
QPtrListIterator<KonqMainWindow> it( *mainWindows );
Q3PtrListIterator<KonqMainWindow> it( *mainWindows );
for (; it.current(); ++it )
lst.append( DCOPRef( kapp->dcopClient()->appId(), it.current()->dcopObject()->objId() ) );
}
return lst;
}
void KonquerorIface::addToCombo( QString url, QCString objId )
void KonquerorIface::addToCombo( QString url, DCOPCString objId )
{
KonqMainWindow::comboAction( KonqMainWindow::ComboAdd, url, objId );
}
void KonquerorIface::removeFromCombo( QString url, QCString objId )
void KonquerorIface::removeFromCombo( QString url, DCOPCString objId )
{
KonqMainWindow::comboAction( KonqMainWindow::ComboRemove, url, objId );
}
void KonquerorIface::comboCleared( QCString objId )
void KonquerorIface::comboCleared( DCOPCString objId )
{
KonqMainWindow::comboAction( KonqMainWindow::ComboClear,
QString::null, objId );
@ -242,11 +246,12 @@ void KonquerorIface::comboCleared( QCString objId )
bool KonquerorIface::processCanBeReused( int screen )
{
if( qt_xscreen() != screen )
QX11Info info;
if( info.screen() != screen )
return false; // this instance run on different screen, and Qt apps can't migrate
if( KonqMainWindow::isPreloaded())
return false; // will be handled by preloading related code instead
QPtrList<KonqMainWindow>* windows = KonqMainWindow::mainWindowList();
Q3PtrList<KonqMainWindow>* windows = KonqMainWindow::mainWindowList();
if( windows == NULL )
return true;
QStringList allowed_parts = KonqSettings::safeParts();
@ -270,7 +275,7 @@ bool KonquerorIface::processCanBeReused( int screen )
}
if( all_parts_allowed )
return true;
for( QPtrListIterator<KonqMainWindow> it1( *windows );
for( Q3PtrListIterator<KonqMainWindow> it1( *windows );
it1 != NULL;
++it1 )
{

View file

@ -22,7 +22,9 @@
#define __KonquerorIface_h__
#include <dcopobject.h>
#include <qvaluelist.h>
#include <q3valuelist.h>
//Added by qt3to4:
#include <Q3CString>
#include <dcopref.h>
#include <qstringlist.h>
@ -48,7 +50,7 @@ k_dcop:
* property on the window.
* This DCOP call is internal to kfmclient, don't use.
*/
DCOPRef openBrowserWindowASN( const QString &url, const QCString &startup_id );
DCOPRef openBrowserWindowASN( const QString &url, const DCOPCString &startup_id );
/**
* Opens a new window for the given @p url (using createNewWindow, i.e. with an appropriate profile)
@ -59,7 +61,7 @@ k_dcop:
* property on the window.
* This DCOP call is internal to kfmclient.
*/
DCOPRef createNewWindowASN( const QString &url, const QCString &startup_id, bool tempFile );
DCOPRef createNewWindowASN( const QString &url, const DCOPCString &startup_id, bool tempFile );
/**
* Opens a new window like @ref createNewWindow, then selects the given @p filesToSelect
@ -70,7 +72,7 @@ k_dcop:
* property on the window.
* This DCOP call is internal to kfmclient.
*/
DCOPRef createNewWindowWithSelectionASN( const QString &url, QStringList filesToSelect, const QCString &startup_id );
DCOPRef createNewWindowWithSelectionASN( const QString &url, QStringList filesToSelect, const DCOPCString &startup_id );
/**
* Opens a new window for the given @p url (using createNewWindow, i.e. with an appropriate profile)
@ -83,7 +85,7 @@ k_dcop:
* This DCOP call is internal to kfmclient.
*/
DCOPRef createNewWindowASN( const QString &url, const QString & mimetype,
const QCString &startup_id, bool tempFile );
const DCOPCString &startup_id, bool tempFile );
/**
* As the name says, this creates a window from a profile.
@ -95,7 +97,7 @@ k_dcop:
* notification ( ASN ) property on the window.
* This DCOP call is internal to kfmclient.
*/
DCOPRef createBrowserWindowFromProfileASN( const QString &path, const QCString &startup_id );
DCOPRef createBrowserWindowFromProfileASN( const QString &path, const DCOPCString &startup_id );
/**
* As the name says, this creates a window from a profile.
@ -110,7 +112,7 @@ k_dcop:
* This DCOP call is internal to kfmclient.
*/
DCOPRef createBrowserWindowFromProfileASN( const QString &path, const QString &filename,
const QCString &startup_id );
const DCOPCString &startup_id );
/**
* Creates a window from a profile and a URL.
@ -127,7 +129,7 @@ k_dcop:
* This DCOP call is internal to kfmclient.
*/
DCOPRef createBrowserWindowFromProfileAndURLASN( const QString &path, const QString &filename, const QString &url,
const QCString &startup_id );
const DCOPCString &startup_id );
/**
* Creates a window the fastest way : the caller has to provide
@ -144,7 +146,7 @@ k_dcop:
* This DCOP call is internal to kfmclient.
*/
DCOPRef createBrowserWindowFromProfileAndURLASN( const QString &path, const QString &filename, const QString &url, const QString &mimetype,
const QCString& startup_id );
const DCOPCString& startup_id );
/**
* Called by kcontrol when the global configuration changes
@ -159,7 +161,7 @@ k_dcop:
/**
* @return a list of references to all the windows
*/
QValueList<DCOPRef> getWindows();
Q3ValueList<DCOPRef> getWindows();
/**
* Called internally as broadcast when the user adds/removes/renames a view profile
@ -169,17 +171,17 @@ k_dcop:
/**
* Called internally as broadcast when a URL is to be added to the combobox.
*/
ASYNC addToCombo( QString, QCString );
ASYNC addToCombo( QString, DCOPCString );
/**
* Called internall as broadcast when a URL has to be removed from the combo.
*/
ASYNC removeFromCombo( QString, QCString );
ASYNC removeFromCombo( QString, DCOPCString );
/**
* Called internally as a broadcast when the combobox was cleared.
*/
ASYNC comboCleared( QCString );
ASYNC comboCleared( DCOPCString );
/**
* Used by kfmclient when the 'minimize memory usage' setting is set

View file

@ -10,12 +10,12 @@
<style type="text/css">
/*<![CDATA[*/
@import "%1"; /* kde_infopage.css */
%1 /* maybe @import "kde_infopage_rtl.css"; */
%2 /* maybe @import "kde_infopage_rtl.css"; */
@import "konq.css";
/*]]>*/
</style>
<title>%1</title>
<title>%3</title>
</head>
<body>
@ -24,11 +24,11 @@
<div id="headerR"/>
<div id="title">
%1 <!-- Konqueror -->
%4 <!-- Konqueror -->
</div>
<div id="tagline">
%1 <!-- Conquer your Desktop -->
%5 <!-- Conquer your Desktop -->
</div>
</div>
@ -38,13 +38,13 @@
<div id="barL">
<div id="barR">
<div id="barCenter" class="bar_text">
%1<br />
%6<br />
<!-- Konqueror is your file manager, web browser and universal document viewer. -->
<ul>
<li><a href="launch.html">%1</a><!--launch--></li>
<li><a class="selected">%1<!-- introduction --></a></li>
<li><a href="tips.html">%1<!--tips--></a></li>
<li><a href="specs.html">%1<!-- specs --></a></li>
<li><a href="launch.html">%7</a><!--launch--></li>
<li><a class="selected">%8<!-- introduction --></a></li>
<li><a href="tips.html">%9<!--tips--></a></li>
<li><a href="specs.html">%10<!-- specs --></a></li>
</ul>
</div>
</div>
@ -59,23 +59,23 @@
<div id="boxR">
<div id="boxCenter">
%1<!--
%11<!--
With Konqueror you have ...
-->
<p>%1</p>
<p>%12</p>
<!-- Simply enter the internet address ...-->
<p>%1
<p>%13
<!--If you want to go back to ...-->
%1<!--To go back to the home-directory...-->
%1</p>
%14<!--To go back to the home-directory...-->
%15</p>
<p><!--For more detailed documentation on Konqueror click here --></p>
<p><table><tr><td valign=middle><img width="32" height="32" border="0" src=
"lightning.png" align="left" alt="" /></td><td valign=top>%1</td></tr></table>
"lightning.png" align="left" alt="" /></td><td valign=top>%16</td></tr></table>
<!--Tuning tip...--></p>
<p id="nextlink"><a href="tips.html">%1&nbsp;%1
<p id="nextlink"><a href="tips.html">%17&nbsp;%18
<!-- Continue --></a></p>
</div>
</div>

View file

@ -1,6 +1,9 @@
#include "konq_aboutpage.h"
#include <qtextcodec.h>
//Added by qt3to4:
#include <QTextStream>
#include <Q3CString>
#include <kaboutdata.h>
#include <kapplication.h>
@ -66,7 +69,7 @@ QString KonqAboutPageFactory::loadFile( const QString& file )
QFile f( file );
if ( !f.open( IO_ReadOnly ) )
if ( !f.open( QIODevice::ReadOnly ) )
return res;
QTextStream t( &f );
@ -503,7 +506,7 @@ void KonqAboutPage::urlSelected( const QString &url, int button, int state, cons
QString profile = locateLocal("data", "konqueror/profiles/webbrowsing");
KSaveFile file( profile );
if ( file.status() == 0 ) {
QCString content = "[Profile]\n"
Q3CString content = "[Profile]\n"
"Name=Web-Browser";
fputs( content.data(), file.fstream() );
file.close();

View file

@ -10,12 +10,12 @@
<style type="text/css">
/*<![CDATA[*/
@import "%1"; /* kde_infopage.css */
%1 /* maybe @import "kde_infopage_rtl.css"; */
%2 /* maybe @import "kde_infopage_rtl.css"; */
@import "konq.css";
/*]]>*/
</style>
<title>%1</title>
<title>%3</title>
</head>
<body>
@ -24,11 +24,11 @@
<div id="headerR"/>
<div id="title">
%1 <!-- Konqueror -->
%4 <!-- Konqueror -->
</div>
<div id="tagline">
%1 <!-- Conquer your Desktop -->
%5 <!-- Conquer your Desktop -->
</div>
</div>
@ -38,13 +38,13 @@
<div id="barL">
<div id="barR">
<div id="barCenter" class="bar_text">
%1<br />
%6<br />
<!-- Konqueror is your file manager, web browser and universal document viewer. -->
<ul>
<li><a class="selected">%1<!--launch--></a></li>
<li><a href="intro.html">%1<!-- intro --></a></li>
<li><a href="tips.html">%1</a><!--tips--></li>
<li><a href="specs.html">%1<!-- specs --></a></li>
<li><a class="selected">%7<!--launch--></a></li>
<li><a href="intro.html">%8<!-- intro --></a></li>
<li><a href="tips.html">%9</a><!--tips--></li>
<li><a href="specs.html">%10<!-- specs --></a></li>
</ul>
</div>
</div>
@ -62,49 +62,49 @@
<table border="0" align="center">
<tr>
<td valign="bottom">
<a href="%1"><img src="%1" height="%1" width="%1" /></a>
<a href="%11"><img src="%12" height="%13" width="%14" /></a>
</td>
<td valign="bottom">
<a href="%1">%1</a><br><span id="subtext"><nobr>%1</span>
<a href="%15">%16</a><br><span id="subtext"><nobr>%17</span>
</td>
<td valign="bottom">
<a href="media:/"><img src="%1" height="%1" width="%1" /></a>
<a href="media:/"><img src="%18" height="%19" width="%20" /></a>
</td>
<td valign="bottom">
<a href="media:/">%1</a><br><span id="subtext"><nobr>%1</span>
<a href="media:/">%21</a><br><span id="subtext"><nobr>%22</span>
</td>
</tr>
<tr>
<td>
<a href="remote:/"><img src="%1" height="%1" width="%1" /></a>
<a href="remote:/"><img src="%23" height="%24" width="%25" /></a>
</td>
<td valign="bottom">
<a href="remote:/">%1</a><br><span id="subtext"><nobr>%1</span>
<a href="remote:/">%26</a><br><span id="subtext"><nobr>%27</span>
</td>
<td>
<a href="trash:/"><img src="%1" height="%1" width="%1" /></a>
<a href="trash:/"><img src="%28" height="%29" width="%30" /></a>
</td>
<td valign="bottom">
<a href="trash:/">%1</a><br><span id="subtext"><nobr>%1</span>
<a href="trash:/">%31</a><br><span id="subtext"><nobr>%32</span>
</td>
</tr>
<tr>
<td>
<a href="applications:/"><img src="%1" height="%1" width="%1" /></a>
<a href="applications:/"><img src="%33" height="%34" width="%35" /></a>
</td>
<td valign="bottom">
<a href="applications:/">%1</a><br><span id="subtext"><nobr>%1</span>
<a href="applications:/">%36</a><br><span id="subtext"><nobr>%37</span>
</td>
<td>
<a href="settings:/"><img src="%1" height="%1" width="%1" /></a>
<a href="settings:/"><img src="%38" height="%39" width="%40" /></a>
</td>
<td valign="bottom">
<a href="settings:/">%1</a><br><span id="subtext"><nobr>%1</span>
<a href="settings:/">%41</a><br><span id="subtext"><nobr>%42</span>
</td>
</tr>
</table>
<p id="nextlink"><a href="intro.html"><img src="%1" width="%1" height="%1">&nbsp;%1
<p id="nextlink"><a href="intro.html"><img src="%43" width="%44" height="%45">&nbsp;%46
<!-- Continue --></a></p>
</div>

View file

@ -10,12 +10,12 @@
<style type="text/css">
/*<![CDATA[*/
@import "%1"; /* kde_infopage.css */
%1 /* maybe @import "kde_infopage_rtl.css"; */
%2 /* maybe @import "kde_infopage_rtl.css"; */
@import "konq.css";
/*]]>*/
</style>
<title>%1</title>
<title>%3</title>
</head>
<body>
@ -24,11 +24,11 @@
<div id="headerR"/>
<div id="title">
%1 <!-- Konqueror -->
%4 <!-- Konqueror -->
</div>
<div id="tagline">
%1 <!-- Conquer your Desktop -->
%5 <!-- Conquer your Desktop -->
</div>
</div>
@ -38,13 +38,13 @@
<div id="barL">
<div id="barR">
<div id="barCenter" class="bar_text">
%1<br />
%6<br />
<!-- Konqueror is your file manager, web browser and universal document viewer. -->
<ul>
<li><a href="launch.html">%1</a><!--launch--></li>
<li><a href="intro.html">%1<!-- intro --></a></li>
<li><a href="tips.html">%1<!--tips--></a></li>
<li><a class="selected">%1<!-- specs --></a></li>
<li><a href="launch.html">%7</a><!--launch--></li>
<li><a href="intro.html">%8<!-- intro --></a></li>
<li><a href="tips.html">%9<!--tips--></a></li>
<li><a class="selected">%10<!-- specs --></a></li>
</ul>
</div>
</div>
@ -58,8 +58,8 @@
<div id="boxL">
<div id="boxR">
<div id="boxCenter">
<h2 style="margin-top: 0px;">%1<h2><!-- Specifications -->
<p>%1 <!-- Konqueror is designed to embrace and support Internet standards.
<h2 style="margin-top: 0px;">%11<h2><!-- Specifications -->
<p>%12 <!-- Konqueror is designed to embrace and support Internet standards.
The aim is to fully implement the officially sanctioned standards from
organisations such as the W3 and OASIS, while also adding extra support for other
common usability features that arise as de facto standards across the internet.
@ -71,64 +71,64 @@
width="100%">
<tr align="left" valign="middle" bgcolor="#505050" height="6">
<td style="color: white">
&nbsp;%1 <!-- Web Browsing -->
&nbsp;%13 <!-- Web Browsing -->
</td>
</tr>
<tr>
<td>
<table border="0" cellspacing="0" cellpadding="2" width="100%">
<tr bgcolor="#DADADA">
<th width="40%">%1 <!--Supported standards--></th>
<th width="40%">%14 <!--Supported standards--></th>
<th width="2%">&nbsp;</th>
<th width="58%">%1 <!--Additional requirements*--></th>
<th width="58%">%15 <!--Additional requirements*--></th>
</tr>
<tr bgcolor="#fff4c9">
<td valign="top">%1 <!--DOM (Level 1, partially Level 2) based HTML 4.01</A>--></td>
<td valign="top">%16 <!--DOM (Level 1, partially Level 2) based HTML 4.01</A>--></td>
<td valign="top">&nbsp;</td>
<td valign="top">%1 <!--built-in--></td>
<td valign="top">%17 <!--built-in--></td>
</tr>
<tr bgcolor="#ffffff">
<td valign="top">%1 <!--Cascading Style Sheets (CSS 1, partially CSS 2)--></td>
<td valign="top">%18 <!--Cascading Style Sheets (CSS 1, partially CSS 2)--></td>
<td valign="top">&nbsp;</td>
<td valign="top">%1 <!--built-in--></td>
<td valign="top">%19 <!--built-in--></td>
</tr>
<tr bgcolor="#fff4c9">
<td valign="top">%1 <!--ECMA-262 Edition 3 (equals roughly Javascript 1.5)--></td>
<td valign="top">%20 <!--ECMA-262 Edition 3 (equals roughly Javascript 1.5)--></td>
<td valign="top">&nbsp;</td>
<noscript>
<td valign="top">%1 <!-- Javascript disabled [...] --></td>
<td valign="top">%21 <!-- Javascript disabled [...] --></td>
</noscript>
<script language="Javascript">
document.write("<td>%1</td>"); // Javascript enabled [...]
document.write("<td>%22</td>"); // Javascript enabled [...]
</script>
</tr>
<tr bgcolor="#ffffff">
<td valign="top">%1 <!--Secure Java support--></td>
<td valign="top">%23 <!--Secure Java support--></td>
<td valign="top">&nbsp;</td>
<td valign="top">
%1<!--JDK 1.2.0 (Java 2) compatible VM (Blackdown, IBM or Sun)--><br>
%1<!--Enable Java (globally) here-->
%24<!--JDK 1.2.0 (Java 2) compatible VM (Blackdown, IBM or Sun)--><br>
%25<!--Enable Java (globally) here-->
</td>
</tr>
<tr bgcolor="#fff4c9">
<td valign="top">%1<!-- Netscape Communicator plugins (for viewing Flash, RealAudio, RealVideo etc.)--></td>
<td valign="top">%26<!-- Netscape Communicator plugins (for viewing Flash, RealAudio, RealVideo etc.)--></td>
<td valign="top">&nbsp;</td>
<td valign="top">%1<!-- built-in--></t#d>
<td valign="top">%27<!-- built-in--></t#d>
</tr>
<tr bgcolor="#ffffff">
<td valign="top"><a href="http://www.netscape.com/eng/ssl3/">%1<!--Secure Sockets Layer--></a> %1<!--(TLS/SSL v2/3) for secure communications up to 168bit--></td>
<td valign="top"><a href="http://www.netscape.com/eng/ssl3/">%28<!--Secure Sockets Layer--></a> %29<!--(TLS/SSL v2/3) for secure communications up to 168bit--></td>
<td valign="top">&nbsp;</td>
<td valign="top"><a href="http://www.openssl.org">%1<!--OpenSSL--></a></td>
<td valign="top"><a href="http://www.openssl.org">%30<!--OpenSSL--></a></td>
</tr>
<tr bgcolor="#fff4c9">
<td valign="top">%1<!--Bidirectional 16bit unicode support--></td>
<td valign="top">%31<!--Bidirectional 16bit unicode support--></td>
<td valign="top">&nbsp;</td>
<td valign="top">%1<!--built-in--></td>
<td valign="top">%32<!--built-in--></td>
</tr>
<tr bgcolor="#ffffff">
<td valign="top">%1<!--AutoCompletion for forms--></td>
<td valign="top">%33<!--AutoCompletion for forms--></td>
<td valign="top">&nbsp;</td>
<td valign="top">%1<!--built-in--></a></td>
<td valign="top">%34<!--built-in--></a></td>
</tr>
</table>
</td>
@ -139,21 +139,21 @@
width="100%">
<tr align="left" valign="middle" bgcolor="#505050" height="6">
<td style="color: white">
%1 <!-- G E N E R A L -->
%35 <!-- G E N E R A L -->
</td>
</tr>
<tr>
<td>
<table border="0" cellspacing="0" cellpadding="2" width="100%">
<tr bgcolor="#dadada">
<th width="40%">%1 <!--Supported standards--></th>
<th width="40%">%36 <!--Supported standards--></th>
<th width="2%">&nbsp;</th>
<th width="58%">%1 <!--Additional requirements*--></th>
<th width="58%">%37 <!--Additional requirements*--></th>
</tr>
<tr bgcolor="#ffffff">
<td valign="top">
%1<!--Image formats:-->
%38<!--Image formats:-->
</td>
<td valign="top">&nbsp;</td>
<td valign="top">
@ -164,25 +164,25 @@
</td>
</tr>
<tr bgcolor="#fff4c9">
<td valign="top"> %1<!--Transfer protocols:-->
<td valign="top"> %39<!--Transfer protocols:-->
</td>
<td valign="top">&nbsp;</td>
<td valign="top">
%1<!--HTTP 1.1 (including gzip/bzip2 compression)--><br>
%1<!--FTP--><br>
%1<!--and many more...--></li>
%40<!--HTTP 1.1 (including gzip/bzip2 compression)--><br>
%41<!--FTP--><br>
%42<!--and many more...--></li>
</ul>
</td>
</tr>
<tr bgcolor="#ffffff">
<td valign="top">
%1<!--URL Completion:-->
%43<!--URL Completion:-->
</td>
<td valign="top">&nbsp;</td>
<td valign="top">
%1<!-- Manual --><br>
%1<!-- Popup --><br>
%1<!-- (Short-) Automatic --></li></ul>
%44<!-- Manual --><br>
%45<!-- Popup --><br>
%46<!-- (Short-) Automatic --></li></ul>
</td>
</tr>
</table>
@ -192,7 +192,7 @@
</table>
<p id="nextlink">
<a href="intro.html">%1&nbsp;%1<!-- Back to the Introduction --></a>
<a href="intro.html">%47&nbsp;%48<!-- Back to the Introduction --></a>
</p>
</div>
</div>

View file

@ -10,12 +10,12 @@
<style type="text/css">
/*<![CDATA[*/
@import "%1"; /* kde_infopage.css */
%1 /* maybe @import "kde_infopage_rtl.css"; */
%2 /* maybe @import "kde_infopage_rtl.css"; */
@import "konq.css";
/*]]>*/
</style>
<title>%1</title>
<title>%3</title>
</head>
<body>
@ -24,11 +24,11 @@
<div id="headerR"/>
<div id="title">
%1 <!-- Konqueror -->
%4 <!-- Konqueror -->
</div>
<div id="tagline">
%1 <!-- Conquer your Desktop -->
%5 <!-- Conquer your Desktop -->
</div>
</div>
@ -38,13 +38,13 @@
<div id="barL">
<div id="barR">
<div id="barCenter" class="bar_text">
%1<br />
%6<br />
<!-- Konqueror is your file manager, web browser and universal document viewer. -->
<ul>
<li><a href="launch.html">%1</a><!--launch--></li>
<li><a href="intro.html">%1<!-- intro --></a></li>
<li><a class="selected">%1<!--tips--></a></li>
<li><a href="specs.html">%1<!-- specs --></a></li>
<li><a href="launch.html">%7</a><!--launch--></li>
<li><a href="intro.html">%8<!-- intro --></a></li>
<li><a class="selected">%9<!--tips--></a></li>
<li><a href="specs.html">%10<!-- specs --></a></li>
</ul>
</div>
</div>
@ -58,61 +58,61 @@
<div id="boxL">
<div id="boxR">
<div id="boxCenter">
<h2 style="margin-top: 0px;">%1<!--Tips--></h2>
<h2 style="margin-top: 0px;">%11<!--Tips--></h2>
<ul style="text-align: left">
<li>%1
<li>%12
<!--Use Internet-Keywords! By typing "gg:KDE" one can search the internet
using google for the search phrase "KDE". There are a lot of
internet-shortcuts predefined to make searching for software or looking up
certain words in an encyclopedia a breeze. And you can even
create your own internet-keywords!--></li>
<li>%1
<li>%13
<!--Use the magnifier toolbar-buttons to increase the
fontsize on your webpage.--></li>
<li>%1
<li>%14
<!--When you want to paste a new address into the URL-bar you might want to
clear the current entry by pressing the white-crossed black arrow in the
toolbar.--></li>
<li>%1
<li>%15
<!--To create a link on your desktop pointing to the current page,
simply drag the "Location" label that is on the left of the Location Toolbar, drop it onto
the desktop, and choose "Link"--></li>
<li>%1
<li>%16
<!--You can also find the "Fullscreen Mode" in the Settings-Menu. This Feature
is very useful for "talk" sessions.--></li>
<li>%1
<li>%17
<!--Divide et impera (lat. "Divide and Konquer") - by splitting a window
into two Parts (e.g. Window -> Split View Left/Right) you can make konqueror
appear the way you like. You can even Load some example view-profiles
(e.g. Midnight-Commander), or create your own ones.--></li>
<li>%1
<li>%18
<!--Use the user-agent feature if the website you're visiting asks you to
use a different browser (and don't forget to send a complaint to the
webmaster!)--></li>
<li>%1
<li>%19
<!--The History in your Sidebar makes sure that you will keep track of the
pages you have visited recently.--></li>
<li>%1
<li>%20
<!--Use a caching proxy to speed up your internet-connection.--></li>
<li>%1
<li>%21
<!--Advanced users will appreciate the konsole which you can embed into
konqueror (Window -> Show Terminal Emulator).--></li>
<li>%1
<li>%22
<!--Thanks to DCOP you can have full control over Konqueror using a script.--></li>
</ul>
<p id="nextlink"><a href="specs.html">%1&nbsp;%1
<p id="nextlink"><a href="specs.html">%23&nbsp;%24
<!-- Continue --></a></p>
</div>
</div>

View file

@ -24,6 +24,8 @@
#include <unistd.h>
#include <qdir.h>
//Added by qt3to4:
#include <Q3CString>
#include <kio/job.h>
#include <kcmdlineargs.h>
@ -47,6 +49,7 @@
#include "kwin.h"
#include <X11/Xlib.h>
#include <QX11Info>
static const char appName[] = "kfmclient";
static const char programName[] = I18N_NOOP("kfmclient");
@ -55,7 +58,7 @@ static const char description[] = I18N_NOOP("KDE tool for opening URLs from the
static const char version[] = "2.0";
QCString clientApp::startup_id_str;
Q3CString clientApp::startup_id_str;
bool clientApp::m_ok;
bool s_interactive = true;
@ -230,8 +233,9 @@ static bool startNewKonqueror( QString url, QString mimetype, const QString& pro
static int currentScreen()
{
if( qt_xdisplay() != NULL )
return qt_xscreen();
QX11Info info;
if( QX11Info::display() != NULL )
return info.screen();
// case when there's no KApplication instance
const char* env = getenv( "DISPLAY" );
if( env == NULL )
@ -244,30 +248,32 @@ static int currentScreen()
}
// when reusing a preloaded konqy, make sure your always use a DCOP call which opens a profile !
static QCString getPreloadedKonqy()
static Q3CString getPreloadedKonqy()
{
KConfig cfg( QString::fromLatin1( "konquerorrc" ), true );
cfg.setGroup( "Reusing" );
if( cfg.readNumEntry( "MaxPreloadCount", 1 ) == 0 )
return "";
DCOPRef ref( "kded", "konqy_preloader" );
QCString ret;
Q3CString ret;
if( ref.callExt( "getPreloadedKonqy", DCOPRef::NoEventLoop, 3000, currentScreen()).get( ret ))
return ret;
return QCString();
return Q3CString();
}
static QCString konqyToReuse( const QString& url, const QString& mimetype, const QString& profile )
static DCOPCString konqyToReuse( const QString& url, const QString& mimetype, const QString& profile )
{ // prefer(?) preloaded ones
QCString ret = getPreloadedKonqy();
DCOPCString ret = getPreloadedKonqy();
if( !ret.isEmpty())
return ret;
if( startNewKonqueror( url, mimetype, profile ))
return "";
QCString appObj;
DCOPCString appObj;
QByteArray data;
QDataStream str( data, IO_WriteOnly );
QDataStream str( &data, QIODevice::WriteOnly );
str.setVersion(QDataStream::Qt_3_1);
str << currentScreen();
if( !KApplication::dcopClient()->findObject( "konqueror*", "KonquerorIface",
"processCanBeReused( int )", data, ret, appObj, false, 3000 ) )
@ -314,9 +320,11 @@ bool clientApp::createNewWindow(const KURL & url, bool newTab, bool tempFile, co
cfg.setGroup( "FMSettings" );
if ( newTab || cfg.readBoolEntry( "KonquerorTabforExternalURL", false ) )
{
QCString foundApp, foundObj;
DCOPCString foundApp, foundObj;
QByteArray data;
QDataStream str( data, IO_WriteOnly );
QDataStream str( &data, QIODevice::WriteOnly );
str.setVersion(QDataStream::Qt_3_1);
if( KApplication::dcopClient()->findObject( "konqueror*", "konqueror-mainwindow*",
"windowCanBeUsedForTab()", data, foundApp, foundObj, false, 3000 ) )
{
@ -329,7 +337,7 @@ bool clientApp::createNewWindow(const KURL & url, bool newTab, bool tempFile, co
}
}
QCString appId = konqyToReuse( url.url(), mimetype, QString::null );
Q3CString appId = konqyToReuse( url.url(), mimetype, QString::null );
if( !appId.isEmpty())
{
kdDebug( 1202 ) << "clientApp::createNewWindow using existing konqueror" << endl;
@ -340,12 +348,12 @@ bool clientApp::createNewWindow(const KURL & url, bool newTab, bool tempFile, co
KStartupInfoData data;
data.addPid( 0 ); // say there's another process for this ASN with unknown PID
data.setHostname(); // ( no need to bother to get this konqy's PID )
Display* dpy = qt_xdisplay();
Display* dpy = QX11Info::display();
if( dpy == NULL ) // we may be running without QApplication here
dpy = XOpenDisplay( NULL );
if( dpy != NULL )
KStartupInfo::sendChangeX( dpy, id, data );
if( dpy != NULL && dpy != qt_xdisplay())
if( dpy != NULL && dpy != QX11Info::display())
XCloseDisplay( dpy );
}
else
@ -378,7 +386,7 @@ bool clientApp::createNewWindow(const KURL & url, bool newTab, bool tempFile, co
bool clientApp::openProfile( const QString & profileName, const QString & url, const QString & mimetype )
{
QCString appId = konqyToReuse( url, mimetype, profileName );
Q3CString appId = konqyToReuse( url, mimetype, profileName );
if( appId.isEmpty())
{
QString error;
@ -411,12 +419,12 @@ bool clientApp::openProfile( const QString & profileName, const QString & url, c
KStartupInfoData sidata;
sidata.addPid( 0 ); // say there's another process for this ASN with unknown PID
sidata.setHostname(); // ( no need to bother to get this konqy's PID )
Display* dpy = qt_xdisplay();
Display* dpy = QX11Info::display();
if( dpy == NULL ) // we may be running without QApplication here
dpy = XOpenDisplay( NULL );
if( dpy != NULL )
KStartupInfo::sendChangeX( dpy, id, sidata );
if( dpy != NULL && dpy != qt_xdisplay())
if( dpy != NULL && dpy != QX11Info::display())
XCloseDisplay( dpy );
return true;
}
@ -451,7 +459,7 @@ bool clientApp::doIt()
if ( !args->isSet( "ninteractive" ) ) {
s_interactive = false;
}
QCString command = args->arg(0);
Q3CString command = args->arg(0);
// read ASN env. variable for non-KApp cases
startup_id_str = KStartupInfo::currentStartupIdEnv().id();

View file

@ -22,6 +22,7 @@
#include <kapplication.h>
#include <krun.h>
#include <Q3CString>
class clientApp : public KApplication
{
@ -42,7 +43,7 @@ protected slots:
private:
static bool m_ok;
static QCString startup_id_str;
static Q3CString startup_id_str;
};

View file

@ -20,6 +20,8 @@
#include "delayedinitializer.h"
#include <qtimer.h>
//Added by qt3to4:
#include <QEvent>
DelayedInitializer::DelayedInitializer( int eventType, QObject *parent, const char *name )
: QObject( parent, name ), m_eventType( eventType ), m_signalEmitted( false )

View file

@ -21,6 +21,8 @@
#define __delayedinitializer_h__
#include <qobject.h>
//Added by qt3to4:
#include <QEvent>
class DelayedInitializer : public QObject
{

View file

@ -48,19 +48,19 @@
#include <config.h>
template class QPtrList<KFileIVI>;
template class Q3PtrList<KFileIVI>;
//template class QValueList<int>;
class KonqIconViewFactory : public KParts::Factory
class KonQ3IconViewFactory : public KParts::Factory
{
public:
KonqIconViewFactory()
KonQ3IconViewFactory()
{
s_defaultViewProps = 0;
s_instance = 0;
}
virtual ~KonqIconViewFactory()
virtual ~KonQ3IconViewFactory()
{
if ( s_instance )
delete s_instance;
@ -102,11 +102,11 @@ public:
static KonqPropsView *s_defaultViewProps;
};
KInstance *KonqIconViewFactory::s_instance = 0;
KonqPropsView *KonqIconViewFactory::s_defaultViewProps = 0;
KInstance *KonQ3IconViewFactory::s_instance = 0;
KonqPropsView *KonQ3IconViewFactory::s_defaultViewProps = 0;
K_EXPORT_COMPONENT_FACTORY( konq_iconview, KonqIconViewFactory )
K_EXPORT_COMPONENT_FACTORY( konq_iconview, KonQ3IconViewFactory )
IconViewBrowserExtension::IconViewBrowserExtension( KonqKfmIconView *iconView )
@ -177,9 +177,9 @@ KonqKfmIconView::KonqKfmIconView( QWidget *parentWidget, QObject *parent, const
setBrowserExtension( new IconViewBrowserExtension( this ) );
// Create a properties instance for this view
m_pProps = new KonqPropsView( KonqIconViewFactory::instance(), KonqIconViewFactory::defaultViewProps() );
m_pProps = new KonqPropsView( KonQ3IconViewFactory::instance(), KonQ3IconViewFactory::defaultViewProps() );
m_pIconView = new KonqIconViewWidget( parentWidget, "qiconview" );
m_pIconView = new KonqIconViewWidget( parentWidget, "Q3IconView" );
m_pIconView->initConfig( true );
connect( m_pIconView, SIGNAL(imagePreviewFinished()),
@ -202,7 +202,7 @@ KonqKfmIconView::KonqKfmIconView( QWidget *parentWidget, QObject *parent, const
setWidget( m_pIconView );
m_mimeTypeResolver = new KMimeTypeResolver<KFileIVI,KonqKfmIconView>(this);
setInstance( KonqIconViewFactory::instance() );
setInstance( KonQ3IconViewFactory::instance() );
setXMLFile( "konq_iconview.rc" );
@ -231,7 +231,7 @@ KonqKfmIconView::KonqKfmIconView( QWidget *parentWidget, QObject *parent, const
for ( KTrader::OfferList::ConstIterator it = plugins.begin(); it != plugins.end(); ++it )
{
if ( KToggleAction*& preview = previewActions[ ( *it )->name() ] )
preview->setName( QCString( preview->name() ) + ',' + ( *it )->desktopEntryName().latin1() );
preview->setName( Q3CString( preview->name() ) + ',' + ( *it )->desktopEntryName().latin1() );
else
{
preview = new KToggleAction( (*it)->name(), 0, actionCollection(), (*it)->desktopEntryName().latin1() );
@ -272,24 +272,24 @@ KonqKfmIconView::KonqKfmIconView( QWidget *parentWidget, QObject *parent, const
connect( aSortByDate, SIGNAL( toggled( bool ) ), this, SLOT( slotSortByDate( bool ) ) );
//enable menu item representing the saved sorting criterion
QString sortcrit = KonqIconViewFactory::defaultViewProps()->sortCriterion();
QString sortcrit = KonQ3IconViewFactory::defaultViewProps()->sortCriterion();
KRadioAction *sort_action = dynamic_cast<KRadioAction *>(actionCollection()->action(sortcrit.latin1()));
if(sort_action!=NULL) sort_action->activate();
m_paSortDirsFirst = new KToggleAction( i18n( "Folders First" ), 0, actionCollection(), "sort_directoriesfirst" );
KToggleAction *aSortDescending = new KToggleAction( i18n( "Descending" ), 0, actionCollection(), "sort_descend" );
m_paSortDirsFirst->setChecked( KonqIconViewFactory::defaultViewProps()->isDirsFirst() );
m_paSortDirsFirst->setChecked( KonQ3IconViewFactory::defaultViewProps()->isDirsFirst() );
connect( aSortDescending, SIGNAL( toggled( bool ) ), this, SLOT( slotSortDescending() ) );
connect( m_paSortDirsFirst, SIGNAL( toggled( bool ) ), this, SLOT( slotSortDirsFirst() ) );
//enable stored settings
slotSortDirsFirst();
if (KonqIconViewFactory::defaultViewProps()->isDescending())
if (KonQ3IconViewFactory::defaultViewProps()->isDescending())
{
aSortDescending->setChecked(true);
m_pIconView->setSorting(true,true);//enable sort ascending in QIconview
m_pIconView->setSorting(true,true);//enable sort ascending in Q3IconView
slotSortDescending();//invert sorting (now descending) and actually resort items
}
@ -302,14 +302,14 @@ KonqKfmIconView::KonqKfmIconView( QWidget *parentWidget, QObject *parent, const
m_pamSort->insert( aSortDescending );
*/
m_paSelect = new KAction( i18n( "Se&lect..." ), CTRL+Key_Plus, this, SLOT( slotSelect() ),
m_paSelect = new KAction( i18n( "Se&lect..." ), Qt::Key_Control+Qt::Key_Plus, this, SLOT( slotSelect() ),
actionCollection(), "select" );
m_paUnselect = new KAction( i18n( "Unselect..." ), CTRL+Key_Minus, this, SLOT( slotUnselect() ),
m_paUnselect = new KAction( i18n( "Unselect..." ), Qt::Key_Control+Qt::Key_Minus, this, SLOT( slotUnselect() ),
actionCollection(), "unselect" );
m_paSelectAll = KStdAction::selectAll( this, SLOT( slotSelectAll() ), actionCollection(), "selectall" );
m_paUnselectAll = new KAction( i18n( "Unselect All" ), CTRL+Key_U, this, SLOT( slotUnselectAll() ),
m_paUnselectAll = new KAction( i18n( "Unselect All" ), Qt::Key_Control+Qt::Key_U, this, SLOT( slotUnselectAll() ),
actionCollection(), "unselectall" );
m_paInvertSelection = new KAction( i18n( "&Invert Selection" ), CTRL+Key_Asterisk,
m_paInvertSelection = new KAction( i18n( "&Invert Selection" ), Qt::Key_Control+Qt::Key_Asterisk,
this, SLOT( slotInvertSelection() ),
actionCollection(), "invertselection" );
@ -326,27 +326,27 @@ KonqKfmIconView::KonqKfmIconView( QWidget *parentWidget, QObject *parent, const
//connect( m_paBottomText, SIGNAL( toggled( bool ) ), this, SLOT( slotTextBottom( bool ) ) );
//connect( m_paRightText, SIGNAL( toggled( bool ) ), this, SLOT( slotTextRight( bool ) ) );
connect( m_pIconView, SIGNAL( executed( QIconViewItem * ) ),
this, SLOT( slotReturnPressed( QIconViewItem * ) ) );
connect( m_pIconView, SIGNAL( returnPressed( QIconViewItem * ) ),
this, SLOT( slotReturnPressed( QIconViewItem * ) ) );
connect( m_pIconView, SIGNAL( executed( Q3IconViewItem * ) ),
this, SLOT( slotReturnPressed( Q3IconViewItem * ) ) );
connect( m_pIconView, SIGNAL( returnPressed( Q3IconViewItem * ) ),
this, SLOT( slotReturnPressed( Q3IconViewItem * ) ) );
connect( m_pIconView, SIGNAL( onItem( QIconViewItem * ) ),
this, SLOT( slotOnItem( QIconViewItem * ) ) );
connect( m_pIconView, SIGNAL( onItem( Q3IconViewItem * ) ),
this, SLOT( slotOnItem( Q3IconViewItem * ) ) );
connect( m_pIconView, SIGNAL( onViewport() ),
this, SLOT( slotOnViewport() ) );
connect( m_pIconView, SIGNAL( mouseButtonPressed(int, QIconViewItem*, const QPoint&)),
this, SLOT( slotMouseButtonPressed(int, QIconViewItem*, const QPoint&)) );
connect( m_pIconView, SIGNAL( mouseButtonClicked(int, QIconViewItem*, const QPoint&)),
this, SLOT( slotMouseButtonClicked(int, QIconViewItem*, const QPoint&)) );
connect( m_pIconView, SIGNAL( contextMenuRequested(QIconViewItem*, const QPoint&)),
this, SLOT( slotContextMenuRequested(QIconViewItem*, const QPoint&)) );
connect( m_pIconView, SIGNAL( mouseButtonPressed(int, Q3IconViewItem*, const QPoint&)),
this, SLOT( slotMouseButtonPressed(int, Q3IconViewItem*, const QPoint&)) );
connect( m_pIconView, SIGNAL( mouseButtonClicked(int, Q3IconViewItem*, const QPoint&)),
this, SLOT( slotMouseButtonClicked(int, Q3IconViewItem*, const QPoint&)) );
connect( m_pIconView, SIGNAL( contextMenuRequested(Q3IconViewItem*, const QPoint&)),
this, SLOT( slotContextMenuRequested(Q3IconViewItem*, const QPoint&)) );
// Signals needed to implement the spring loading folders behavior
connect( m_pIconView, SIGNAL( held( QIconViewItem * ) ),
this, SLOT( slotDragHeld( QIconViewItem * ) ) );
connect( m_pIconView, SIGNAL( held( Q3IconViewItem * ) ),
this, SLOT( slotDragHeld( Q3IconViewItem * ) ) );
connect( m_pIconView, SIGNAL( dragEntered( bool ) ),
this, SLOT( slotDragEntered( bool ) ) );
connect( m_pIconView, SIGNAL( dragLeft() ),
@ -392,7 +392,7 @@ KonqKfmIconView::KonqKfmIconView( QWidget *parentWidget, QObject *parent, const
m_bUpdateContentsPosAfterListing = false;
m_bDirPropertiesChanged = true;
m_bPreviewRunningBeforeCloseURL = false;
m_pIconView->setResizeMode( QIconView::Adjust );
m_pIconView->setResizeMode( Q3IconView::Adjust );
connect( m_pIconView, SIGNAL( selectionChanged() ),
this, SLOT( slotSelectionChanged() ) );
@ -429,7 +429,7 @@ const KFileItem * KonqKfmIconView::currentItem()
void KonqKfmIconView::slotPreview( bool toggle )
{
QCString name = sender()->name(); // e.g. clipartthumbnail (or audio/, special case)
Q3CString name = sender()->name(); // e.g. clipartthumbnail (or audio/, special case)
if (name == "iconview_preview_all")
{
m_pProps->setShowingPreview( toggle );
@ -442,7 +442,7 @@ void KonqKfmIconView::slotPreview( bool toggle )
bool previewRunning = m_pIconView->isPreviewRunning();
if ( previewRunning )
m_pIconView->stopImagePreview();
m_pIconView->setIcons( m_pIconView->iconSize(), "*" );
m_pIconView->setIcons( m_pIconView->iconSize(), QStringList() += "*" );
}
else
{
@ -502,7 +502,7 @@ void KonqKfmIconView::slotShowDirectoryOverlays()
m_pProps->setShowingDirectoryOverlays( show );
for ( QIconViewItem *item = m_pIconView->firstItem(); item; item = item->nextItem() )
for ( Q3IconViewItem *item = m_pIconView->firstItem(); item; item = item->nextItem() )
{
KFileIVI* kItem = static_cast<KFileIVI*>(item);
if ( !kItem->item()->isDir() ) continue;
@ -528,7 +528,7 @@ void KonqKfmIconView::slotSelect()
m_pIconView->blockSignals( true );
QIconViewItem *it = m_pIconView->firstItem();
Q3IconViewItem *it = m_pIconView->firstItem();
while ( it )
{
if ( re.exactMatch( it->text() ) )
@ -555,7 +555,7 @@ void KonqKfmIconView::slotUnselect()
m_pIconView->blockSignals( true );
QIconViewItem *it = m_pIconView->firstItem();
Q3IconViewItem *it = m_pIconView->firstItem();
while ( it )
{
if ( re.exactMatch( it->text() ) )
@ -591,7 +591,7 @@ void KonqKfmIconView::slotSortByNameCaseSensitive( bool toggle )
if ( !toggle )
return;
KonqIconViewFactory::defaultViewProps()->setSortCriterion("sort_nc");
KonQ3IconViewFactory::defaultViewProps()->setSortCriterion("sort_nc");
setupSorting( NameCaseSensitive );
}
@ -600,7 +600,7 @@ void KonqKfmIconView::slotSortByNameCaseInsensitive( bool toggle )
if ( !toggle )
return;
KonqIconViewFactory::defaultViewProps()->setSortCriterion("sort_nci");
KonQ3IconViewFactory::defaultViewProps()->setSortCriterion("sort_nci");
setupSorting( NameCaseInsensitive );
}
@ -609,7 +609,7 @@ void KonqKfmIconView::slotSortBySize( bool toggle )
if ( !toggle )
return;
KonqIconViewFactory::defaultViewProps()->setSortCriterion("sort_size");
KonQ3IconViewFactory::defaultViewProps()->setSortCriterion("sort_size");
setupSorting( Size );
}
@ -618,7 +618,7 @@ void KonqKfmIconView::slotSortByType( bool toggle )
if ( !toggle )
return;
KonqIconViewFactory::defaultViewProps()->setSortCriterion("sort_type");
KonQ3IconViewFactory::defaultViewProps()->setSortCriterion("sort_type");
setupSorting( Type );
}
@ -627,7 +627,7 @@ void KonqKfmIconView::slotSortByDate( bool toggle )
if( !toggle)
return;
KonqIconViewFactory::defaultViewProps()->setSortCriterion("sort_date");
KonQ3IconViewFactory::defaultViewProps()->setSortCriterion("sort_date");
setupSorting( Date );
}
@ -651,7 +651,7 @@ void KonqKfmIconView::slotSortDescending()
m_pIconView->sort( m_pIconView->sortDirection() );
KonqIconViewFactory::defaultViewProps()->setDescending( !m_pIconView->sortDirection() );
KonQ3IconViewFactory::defaultViewProps()->setDescending( !m_pIconView->sortDirection() );
}
void KonqKfmIconView::slotSortDirsFirst()
@ -662,7 +662,7 @@ void KonqKfmIconView::slotSortDirsFirst()
m_pIconView->sort( m_pIconView->sortDirection() );
KonqIconViewFactory::defaultViewProps()->setDirsFirst( m_paSortDirsFirst->isChecked() );
KonQ3IconViewFactory::defaultViewProps()->setDirsFirst( m_paSortDirsFirst->isChecked() );
}
void KonqKfmIconView::newIconSize( int size )
@ -705,7 +705,7 @@ bool KonqKfmIconView::doCloseURL()
return true;
}
void KonqKfmIconView::slotReturnPressed( QIconViewItem *item )
void KonqKfmIconView::slotReturnPressed( Q3IconViewItem *item )
{
if ( !item )
return;
@ -733,7 +733,7 @@ void KonqKfmIconView::slotReturnPressed( QIconViewItem *item )
#endif
}
void KonqKfmIconView::slotDragHeld( QIconViewItem *item )
void KonqKfmIconView::slotDragHeld( Q3IconViewItem *item )
{
kdDebug() << "KonqKfmIconView::slotDragHeld()" << endl;
@ -778,7 +778,7 @@ void KonqKfmIconView::slotDragFinished()
}
void KonqKfmIconView::slotContextMenuRequested(QIconViewItem* _item, const QPoint& _global)
void KonqKfmIconView::slotContextMenuRequested(Q3IconViewItem* _item, const QPoint& _global)
{
const KFileItemList items = m_pIconView->selectedFileItems();
if ( items.isEmpty() )
@ -794,7 +794,7 @@ void KonqKfmIconView::slotContextMenuRequested(QIconViewItem* _item, const QPoin
if ( rootItem ) {
KURL parentDirURL = rootItem->url();
// Check if parentDirURL applies to the selected items (usually yes, but not with search results)
QPtrListIterator<KFileItem> kit( items );
Q3PtrListIterator<KFileItem> kit( items );
for ( ; kit.current(); ++kit )
if ( kit.current()->url().directory( 1 ) != rootItem->url().path() )
parentDirURL = KURL();
@ -806,9 +806,9 @@ void KonqKfmIconView::slotContextMenuRequested(QIconViewItem* _item, const QPoin
emit m_extension->popupMenu( 0L, _global, items, KParts::URLArgs(), popupFlags);
}
void KonqKfmIconView::slotMouseButtonPressed(int _button, QIconViewItem* _item, const QPoint&)
void KonqKfmIconView::slotMouseButtonPressed(int _button, Q3IconViewItem* _item, const QPoint&)
{
if ( _button == RightButton && !_item )
if ( _button == Qt::RightButton && !_item )
{
// Right click on viewport
KFileItem * item = m_dirLister->rootItem();
@ -843,9 +843,9 @@ void KonqKfmIconView::slotMouseButtonPressed(int _button, QIconViewItem* _item,
}
}
void KonqKfmIconView::slotMouseButtonClicked(int _button, QIconViewItem* _item, const QPoint& )
void KonqKfmIconView::slotMouseButtonClicked(int _button, Q3IconViewItem* _item, const QPoint& )
{
if( _button == MidButton )
if( _button == Qt::MidButton )
mmbClicked( _item ? static_cast<KFileIVI*>(_item)->item() : 0L );
}
@ -910,12 +910,12 @@ void KonqKfmIconView::slotCompleted()
m_pIconView->viewport()->repaint();
}
// Root item ? Store root item in konqiconviewwidget (whether 0L or not)
// Root item ? Store root item in konQ3IconViewwidget (whether 0L or not)
m_pIconView->setRootItem( m_dirLister->rootItem() );
// only after initial listing, not after updates
// If we don't set a current item, the iconview has none (one more keypress needed)
// but it appears on focusin... qiconview bug, Reggie acknowledged it LONG ago (07-2000).
// but it appears on focusin... Q3IconView bug, Reggie acknowledged it LONG ago (07-2000).
if ( m_bNeedSetCurrentItem )
{
m_pIconView->setCurrentItem( m_pIconView->firstItem() );
@ -1177,7 +1177,7 @@ void KonqKfmIconView::slotClear()
m_mimeTypeResolver->m_lstPendingMimeIconItems.clear();
m_itemDict.clear();
// Bug in QIconview IMHO - it should emit selectionChanged()
// Bug in Q3IconView IMHO - it should emit selectionChanged()
// (bug reported, but code seems to be that way on purpose)
m_pIconView->slotSelectionChanged();
slotSelectionChanged();
@ -1275,7 +1275,7 @@ bool KonqKfmIconView::doOpenURL( const KURL & url )
m_dirLister->setMimeFilter( mimeFilter() );
// This *must* happen before m_dirLister->openURL because it emits
// clear() and QIconView::clear() calls setContentsPos(0,0)!
// clear() and Q3IconView::clear() calls setContentsPos(0,0)!
KParts::URLArgs args = m_extension->urlArgs();
if ( args.reload )
{
@ -1339,7 +1339,7 @@ void KonqKfmIconView::slotKFindClosed()
m_dirLister->setAutoUpdate( true );
}
void KonqKfmIconView::slotOnItem( QIconViewItem *item )
void KonqKfmIconView::slotOnItem( Q3IconViewItem *item )
{
emit setStatusBarText( static_cast<KFileIVI *>(item)->item()->getStatusBarInfo() );
emitMouseOver( static_cast<KFileIVI*>(item)->item());
@ -1356,19 +1356,19 @@ void KonqKfmIconView::setViewMode( const QString &mode )
{
if ( mode == m_mode )
return;
// note: this should be moved to KonqIconViewWidget. It would make the code
// note: this should be moved to KonQ3IconViewWidget. It would make the code
// more readable :)
m_mode = mode;
if (mode=="MultiColumnView")
{
m_pIconView->setArrangement(QIconView::TopToBottom);
m_pIconView->setItemTextPos(QIconView::Right);
m_pIconView->setArrangement(Q3IconView::TopToBottom);
m_pIconView->setItemTextPos(Q3IconView::Right);
}
else
{
m_pIconView->setArrangement(QIconView::LeftToRight);
m_pIconView->setItemTextPos(QIconView::Bottom);
m_pIconView->setArrangement(Q3IconView::LeftToRight);
m_pIconView->setItemTextPos(Q3IconView::Bottom);
}
if ( m_bPreviewRunningBeforeCloseURL )
@ -1385,28 +1385,28 @@ void KonqKfmIconView::setupSortKeys()
{
case NameCaseSensitive:
m_pIconView->setCaseInsensitiveSort( false );
for ( QIconViewItem *it = m_pIconView->firstItem(); it; it = it->nextItem() )
for ( Q3IconViewItem *it = m_pIconView->firstItem(); it; it = it->nextItem() )
it->setKey( it->text() );
break;
case NameCaseInsensitive:
m_pIconView->setCaseInsensitiveSort( true );
for ( QIconViewItem *it = m_pIconView->firstItem(); it; it = it->nextItem() )
for ( Q3IconViewItem *it = m_pIconView->firstItem(); it; it = it->nextItem() )
it->setKey( it->text().lower() );
break;
case Size:
for ( QIconViewItem *it = m_pIconView->firstItem(); it; it = it->nextItem() )
for ( Q3IconViewItem *it = m_pIconView->firstItem(); it; it = it->nextItem() )
it->setKey( makeSizeKey( (KFileIVI *)it ) );
break;
case Type:
// Sort by Type + Name (#17014)
for ( QIconViewItem *it = m_pIconView->firstItem(); it; it = it->nextItem() )
for ( Q3IconViewItem *it = m_pIconView->firstItem(); it; it = it->nextItem() )
it->setKey( static_cast<KFileIVI *>( it )->item()->mimetype() + "\008" + it->text().lower() );
break;
case Date:
{
//Sorts by time of modification (#52750)
QDateTime dayt;
for ( QIconViewItem *it = m_pIconView->firstItem(); it; it = it->nextItem() )
for ( Q3IconViewItem *it = m_pIconView->firstItem(); it; it = it->nextItem() )
{
dayt.setTime_t(static_cast<KFileIVI *>( it )->item()->time(KIO::UDS_MODIFICATION_TIME));
it->setKey(dayt.toString("yyyyMMddhhmmss"));
@ -1456,7 +1456,7 @@ bool SpringLoadingManager::exists()
void SpringLoadingManager::springLoadTrigger(KonqKfmIconView *view,
KFileItem *file,
QIconViewItem *item)
Q3IconViewItem *item)
{
if ( !file || !file->isDir() )
return;

View file

@ -24,8 +24,8 @@
#include <konq_operations.h>
#include <konq_dirpart.h>
#include <kmimetyperesolver.h>
#include <qptrdict.h>
#include <qptrlist.h>
#include <q3ptrdict.h>
#include <q3ptrlist.h>
#include <kfileivi.h>
class KonqPropsView;
@ -34,7 +34,7 @@ class KDirLister;
class KAction;
class KToggleAction;
class KActionMenu;
class QIconViewItem;
class Q3IconViewItem;
class IconViewBrowserExtension;
/**
@ -92,17 +92,17 @@ public slots:
void slotSortDirsFirst();
protected slots:
// slots connected to QIconView
void slotReturnPressed( QIconViewItem *item );
void slotMouseButtonPressed(int, QIconViewItem*, const QPoint&);
void slotMouseButtonClicked(int, QIconViewItem*, const QPoint&);
void slotContextMenuRequested(QIconViewItem*, const QPoint&);
void slotOnItem( QIconViewItem *item );
// slots connected to Q3IconView
void slotReturnPressed( Q3IconViewItem *item );
void slotMouseButtonPressed(int, Q3IconViewItem*, const QPoint&);
void slotMouseButtonClicked(int, Q3IconViewItem*, const QPoint&);
void slotContextMenuRequested(Q3IconViewItem*, const QPoint&);
void slotOnItem( Q3IconViewItem *item );
void slotOnViewport();
void slotSelectionChanged();
// Slot used for spring loading folders
void slotDragHeld( QIconViewItem *item );
void slotDragHeld( Q3IconViewItem *item );
void slotDragMove( bool accepted );
void slotDragEntered( bool accepted );
void slotDragLeft();
@ -197,13 +197,13 @@ protected:
KToggleAction *m_paDotFiles;
KToggleAction *m_paDirectoryOverlays;
KToggleAction *m_paEnablePreviews;
QPtrList<KFileIVI> m_paOutstandingOverlays;
Q3PtrList<KFileIVI> m_paOutstandingOverlays;
QTimer *m_paOutstandingOverlaysTimer;
/* KToggleAction *m_paImagePreview;
KToggleAction *m_paTextPreview;
KToggleAction *m_paHTMLPreview;*/
KActionMenu *m_pamPreview;
QPtrList<KToggleAction> m_paPreviewPlugins;
Q3PtrList<KToggleAction> m_paPreviewPlugins;
KActionMenu *m_pamSort;
KAction *m_paSelect;
@ -218,7 +218,7 @@ protected:
QTimer *m_pTimeoutRefreshTimer;
QPtrDict<KFileIVI> m_itemDict; // maps KFileItem * -> KFileIVI *
Q3PtrDict<KFileIVI> m_itemDict; // maps KFileItem * -> KFileIVI *
KMimeTypeResolver<KFileIVI,KonqKfmIconView> * m_mimeTypeResolver;
@ -277,7 +277,7 @@ public:
static bool exists();
void springLoadTrigger(KonqKfmIconView *view, KFileItem *file,
QIconViewItem *item);
Q3IconViewItem *item);
void dragLeft(KonqKfmIconView *view);
void dragEntered(KonqKfmIconView *view);

View file

@ -33,14 +33,16 @@
#include "konq_view.h"
#include "konq_settingsxt.h"
//Added by qt3to4:
#include <Q3PtrList>
template class QPtrList<KonqHistoryEntry>;
template class Q3PtrList<KonqHistoryEntry>;
/////////////////
//static - used by KonqHistoryAction and KonqBidiHistoryAction
void KonqBidiHistoryAction::fillHistoryPopup( const QPtrList<HistoryEntry> &history,
QPopupMenu * popup,
void KonqBidiHistoryAction::fillHistoryPopup( const Q3PtrList<HistoryEntry> &history,
Q3PopupMenu * popup,
bool onlyBack,
bool onlyForward,
bool checkCurrentItem,
@ -50,7 +52,7 @@ void KonqBidiHistoryAction::fillHistoryPopup( const QPtrList<HistoryEntry> &hist
//kdDebug(1202) << "fillHistoryPopup position: " << history.at() << endl;
HistoryEntry * current = history.current();
QPtrListIterator<HistoryEntry> it( history );
Q3PtrListIterator<HistoryEntry> it( history );
if (onlyBack || onlyForward)
{
it += history.at(); // Jump to current item
@ -69,8 +71,8 @@ void KonqBidiHistoryAction::fillHistoryPopup( const QPtrList<HistoryEntry> &hist
int id = popup->insertItem( text ); // no pixmap if checked
popup->setItemChecked( id, true );
} else
popup->insertItem( KonqPixmapProvider::self()->pixmapFor(
it.current()->url.url() ), text );
popup->insertItem( QIcon( KonqPixmapProvider::self()->pixmapFor(
it.current()->url.url() ) ), text );
if ( ++i > 10 )
break;
if ( !onlyForward ) --it; else ++it;
@ -96,7 +98,7 @@ int KonqBidiHistoryAction::plug( QWidget *widget, int index )
// Go menu
if ( widget->inherits("QPopupMenu") )
{
m_goMenu = (QPopupMenu*)widget;
m_goMenu = (Q3PopupMenu*)widget;
// Forward signal (to main view)
connect( m_goMenu, SIGNAL( aboutToShow() ),
this, SIGNAL( menuAboutToShow() ) );
@ -111,7 +113,7 @@ int KonqBidiHistoryAction::plug( QWidget *widget, int index )
return KAction::plug( widget, index );
}
void KonqBidiHistoryAction::fillGoMenu( const QPtrList<HistoryEntry> & history )
void KonqBidiHistoryAction::fillGoMenu( const Q3PtrList<HistoryEntry> & history )
{
if (history.isEmpty())
return; // nothing to do
@ -179,12 +181,12 @@ KonqLogoAction::KonqLogoAction( const QString& text, int accel,
{
}
KonqLogoAction::KonqLogoAction( const QString& text, const QIconSet& pix, int accel, QObject* parent, const char* name )
KonqLogoAction::KonqLogoAction( const QString& text, const QIcon& pix, int accel, QObject* parent, const char* name )
: KAction( text, pix, accel, parent, name )
{
}
KonqLogoAction::KonqLogoAction( const QString& text, const QIconSet& pix,int accel, QObject* receiver, const char* slot, QObject* parent, const char* name )
KonqLogoAction::KonqLogoAction( const QString& text, const QIcon& pix,int accel, QObject* receiver, const char* slot, QObject* parent, const char* name )
: KAction( text, pix, accel, receiver, slot, parent, name )
{
}
@ -282,7 +284,7 @@ KonqViewModeAction::KonqViewModeAction( const QString &text, const QString &icon
QObject *parent, const char *name )
: KRadioAction( text, icon, 0, parent, name )
{
m_menu = new QPopupMenu;
m_menu = new Q3PopupMenu;
connect( m_menu, SIGNAL( aboutToShow() ),
this, SLOT( slotPopupAboutToShow() ) );
@ -453,7 +455,7 @@ void KonqMostOftenURLSAction::slotFillMenu()
entry->title;
popupMenu()->insertItem(
KonqPixmapProvider::self()->pixmapFor( entry->url.url() ),
QIcon(KonqPixmapProvider::self()->pixmapFor( entry->url.url() )),
text, id );
// Keep a copy of the URLs being shown in the menu
// This prevents crashes when another process tells us to remove an entry.
@ -487,8 +489,8 @@ void KonqMostOftenURLSAction::slotActivated( int id )
}
// sort by numberOfTimesVisited (least often goes first)
int MostOftenList::compareItems( QPtrCollection::Item item1,
QPtrCollection::Item item2)
int MostOftenList::compareItems( Q3PtrCollection::Item item1,
Q3PtrCollection::Item item2)
{
KonqHistoryEntry *entry1 = static_cast<KonqHistoryEntry *>( item1 );
KonqHistoryEntry *entry2 = static_cast<KonqHistoryEntry *>( item2 );

View file

@ -22,10 +22,10 @@
#include <konq_historymgr.h>
#include <kaction.h>
#include <qptrlist.h>
#include <q3ptrlist.h>
class HistoryEntry;
class QPopupMenu;
class Q3PopupMenu;
/**
* Plug this action into a menu to get a bidirectional history
@ -42,11 +42,11 @@ public:
virtual int plug( QWidget *widget, int index = -1 );
//virtual void unplug( QWidget *widget );
void fillGoMenu( const QPtrList<HistoryEntry> &history );
void fillGoMenu( const Q3PtrList<HistoryEntry> &history );
// Used by KonqHistoryAction and KonqBidiHistoryAction
static void fillHistoryPopup( const QPtrList<HistoryEntry> &history,
QPopupMenu * popup,
static void fillHistoryPopup( const Q3PtrList<HistoryEntry> &history,
Q3PopupMenu * popup,
bool onlyBack = false,
bool onlyForward = false,
bool checkCurrentItem = false,
@ -63,7 +63,7 @@ private:
uint m_firstIndex; // first index in the Go menu
int m_startPos;
int m_currentPos; // == history.at()
QPopupMenu *m_goMenu; // hack
Q3PopupMenu *m_goMenu; // hack
};
/////
@ -75,9 +75,9 @@ public:
KonqLogoAction( const QString& text, int accel = 0, QObject* parent = 0, const char* name = 0 );
KonqLogoAction( const QString& text, int accel,
QObject* receiver, const char* slot, QObject* parent, const char* name = 0 );
KonqLogoAction( const QString& text, const QIconSet& pix, int accel = 0,
KonqLogoAction( const QString& text, const QIcon& pix, int accel = 0,
QObject* parent = 0, const char* name = 0 );
KonqLogoAction( const QString& text, const QIconSet& pix, int accel,
KonqLogoAction( const QString& text, const QIcon& pix, int accel,
QObject* receiver, const char* slot, QObject* parent, const char* name = 0 );
// text missing !
KonqLogoAction( const QStringList& icons, QObject* receiver,
@ -103,7 +103,7 @@ public:
virtual int plug( QWidget *widget, int index = -1 );
QPopupMenu *popupMenu() const { return m_menu; }
Q3PopupMenu *popupMenu() const { return m_menu; }
private slots:
void slotPopupAboutToShow();
@ -112,7 +112,7 @@ private slots:
private:
bool m_popupActivated;
QPopupMenu *m_menu;
Q3PopupMenu *m_menu;
};
class MostOftenList : public KonqBaseHistoryList
@ -121,7 +121,7 @@ protected:
/**
* Ensures that the items are sorted by numberOfTimesVisited
*/
virtual int compareItems( QPtrCollection::Item, QPtrCollection::Item );
virtual int compareItems( Q3PtrCollection::Item, Q3PtrCollection::Item );
};
class KonqMostOftenURLSAction : public KActionMenu

View file

@ -19,6 +19,13 @@
#include <qpainter.h>
#include <qstyle.h>
//Added by qt3to4:
#include <QPixmap>
#include <QPaintEvent>
#include <QEvent>
#include <QKeyEvent>
#include <Q3ValueList>
#include <QMouseEvent>
#include <kapplication.h>
#include <kconfig.h>
#include <kcompletionbox.h>
@ -34,11 +41,16 @@
#include <dcopclient.h>
#include "konq_view.h"
#include "konq_combo.h"
KConfig * KonqCombo::s_config = 0L;
const int KonqCombo::temporary = 0;
#ifdef __GNUC__
#warning "This needs massive porting, mostly stubbed out"
#endif
static QString titleOfURL( const KURL& url )
{
KonqHistoryList historylist = KonqHistoryManager::kself()->entries();
@ -51,7 +63,8 @@ static QString titleOfURL( const KURL& url )
return ( historyentry ? historyentry->title : QString::null );
}
class Q_EXPORT KonqComboListBoxPixmap : public QListBoxItem
#if 0
class Q_EXPORT KonqComboListBoxPixmap : public Q3ListBoxItem
{
public:
KonqComboListBoxPixmap( const QString& text );
@ -59,8 +72,8 @@ public:
const QPixmap *pixmap() const { return &pm; }
int height( const QListBox * ) const;
int width( const QListBox * ) const;
int height( const Q3ListBox * ) const;
int width( const Q3ListBox * ) const;
int rtti() const;
static int RTTI;
@ -90,12 +103,13 @@ public:
void setItems( const QStringList& items );
void insertStringList( const QStringList & list, int index = -1 );
};
#endif
KonqCombo::KonqCombo( QWidget *parent, const char *name )
: KHistoryCombo( parent, name ),
m_returnPressed( false ),
m_permanent( false ),
m_modifier( NoButton ),
m_modifier( Qt::NoButton ),
m_pageSecurity( KonqMainWindow::NotCrypted )
{
setInsertionPolicy( NoInsertion );
@ -112,14 +126,14 @@ KonqCombo::KonqCombo( QWidget *parent, const char *name )
// handling of signals later.
setHandleSignals( true );
KonqComboLineEdit *edit = new KonqComboLineEdit( this, "combo lineedit" );
edit->setHandleSignals( true );
edit->setCompletionBox( new KonqComboCompletionBox( edit, "completion box" ) );
setLineEdit( edit );
//KonqComboLineEdit *edit = new KonqComboLineEdit( this, "combo lineedit" );
//edit->setHandleSignals( true );
//edit->setCompletionBox( new KonqComboCompletionBox( edit, "completion box" ) );
//setLineEdit( edit );
completionBox()->setTabHandling( true );
// Make the lineedit consume the Key_Enter event...
// Make the lineedit consume the Qt::Key_Enter event...
setTrapReturnKey( true );
connect( this, SIGNAL(cleared() ), SLOT(slotCleared()) );
@ -152,7 +166,9 @@ void KonqCombo::setURL( const QString& url )
if ( m_returnPressed ) { // Really insert...
m_returnPressed = false;
QByteArray data;
QDataStream s( data, IO_WriteOnly );
QDataStream s( &data, QIODevice::WriteOnly );
s.setVersion(QDataStream::Qt_3_1);
s << url << kapp->dcopClient()->defaultObject();
kapp->dcopClient()->send( "konqueror*", "KonquerorIface",
"addToCombo(QString,QCString)", data);
@ -235,21 +251,21 @@ void KonqCombo::applyPermanent()
void KonqCombo::insertItem( const QString &text, int index, const QString& title )
{
KonqComboListBoxPixmap* item = new KonqComboListBoxPixmap( 0, text, title );
listBox()->insertItem( item, index );
//KonqComboListBoxPixmap* item = new KonqComboListBoxPixmap( 0, text, title );
KHistoryCombo::insertItem( text /*item*/, index );
}
void KonqCombo::insertItem( const QPixmap &pixmap, const QString& text, int index, const QString& title )
{
KonqComboListBoxPixmap* item = new KonqComboListBoxPixmap( pixmap, text, title );
listBox()->insertItem( item, index );
//KonqComboListBoxPixmap* item = new KonqComboListBoxPixmap( pixmap, text, title );
KHistoryCombo::insertItem( pixmap, text, /*item, */ index );
}
void KonqCombo::updateItem( const QPixmap& pix, const QString& t, int index, const QString& title )
{
// No need to flicker
if (text( index ) == t &&
(pixmap(index) && pixmap(index)->serialNumber() == pix.serialNumber()))
(!pixmap(index).isNull() && pixmap(index).serialNumber() == pix.serialNumber()))
return;
// kdDebug(1202) << "KonqCombo::updateItem: item='" << t << "', index='"
@ -260,8 +276,9 @@ void KonqCombo::updateItem( const QPixmap& pix, const QString& t, int index, con
// ### use QComboBox::changeItem(), once that finally works
// Well lets try it now as it seems to work fine for me. We
// can always revert :)
KonqComboListBoxPixmap* item = new KonqComboListBoxPixmap( pix, t, title );
listBox()->changeItem( item, index );
//KonqComboListBoxPixmap* item = new KonqComboListBoxPixmap( pix, t, title );
//listBox()->changeItem( item, index );
changeItem( pix, t, index );
/*
setUpdatesEnabled( false );
@ -338,7 +355,7 @@ void KonqCombo::loadItems()
void KonqCombo::slotSetIcon( int index )
{
if( pixmap( index ) == NULL )
if( pixmap( index ).isNull())
// on-demand icon loading
updateItem( KonqPixmapProvider::self()->pixmapFor( text( index ),
KIcon::SizeSmall ), text( index ), index,
@ -346,11 +363,22 @@ void KonqCombo::slotSetIcon( int index )
update();
}
void KonqCombo::getStyleOption(QStyleOptionComboBox* comboOpt)
{
//We only use this for querying metrics,so it's rough..
comboOpt->init(this);
comboOpt->editable = isEditable();
comboOpt->frame = hasFrame();
comboOpt->iconSize = iconSize();
comboOpt->currentIcon = itemIcon(currentIndex());
comboOpt->currentText = currentText();
}
void KonqCombo::popup()
{
for( int i = 0; i < count(); ++i )
{
if( pixmap( i ) == NULL || pixmap( i )->isNull() )
if( pixmap( i ).isNull() )
{
// on-demand icon loading
updateItem( KonqPixmapProvider::self()->pixmapFor( text( i ),
@ -393,15 +421,15 @@ bool KonqCombo::eventFilter( QObject *o, QEvent *ev )
if ( type == QEvent::KeyPress ) {
QKeyEvent *e = static_cast<QKeyEvent *>( ev );
if ( e->key() == Key_Return || e->key() == Key_Enter ) {
if ( e->key() == Qt::Key_Return || e->key() == Qt::Key_Enter ) {
m_modifier = e->state();
return false;
}
if ( KKey( e ) == KKey( int( KStdAccel::deleteWordBack() ) ) ||
KKey( e ) == KKey( int( KStdAccel::deleteWordForward() ) ) ||
((e->state() & ControlButton) &&
(e->key() == Key_Left || e->key() == Key_Right) ) ) {
((e->modifiers() & Qt::ControlModifier) &&
(e->key() == Qt::Key_Left || e->key() == Qt::Key_Right) ) ) {
selectWord(e);
e->accept();
return true;
@ -441,11 +469,11 @@ void KonqCombo::selectWord(QKeyEvent *e)
int count = 0;
// TODO: make these a parameter when in kdelibs/kdeui...
QValueList<QChar> chars;
Q3ValueList<QChar> chars;
chars << QChar('/') << QChar('.') << QChar('?') << QChar('#') << QChar(':');
bool allow_space_break = true;
if( e->key() == Key_Left || e->key() == Key_Backspace ) {
if( e->key() == Qt::Key_Left || e->key() == Qt::Key_Backspace ) {
do {
pos--;
count++;
@ -453,10 +481,10 @@ void KonqCombo::selectWord(QKeyEvent *e)
break;
} while( pos >= 0 && (chars.findIndex(text[pos]) == -1 || count <= 1) );
if( e->state() & ShiftButton ) {
if( e->modifiers() & Qt::ShiftModifier ) {
edit->cursorForward(true, 1-count);
}
else if( e->key() == Key_Backspace ) {
else if( e->key() == Qt::Key_Backspace ) {
edit->cursorForward(false, 1-count);
QString text = edit->text();
int pos_to_right = edit->text().length() - pos_old;
@ -468,7 +496,7 @@ void KonqCombo::selectWord(QKeyEvent *e)
edit->cursorForward(false, 1-count);
}
}
else if( e->key() == Key_Right || e->key() == Key_Delete ){
else if( e->key() == Qt::Key_Right || e->key() == Qt::Key_Delete ){
do {
pos++;
count++;
@ -476,10 +504,10 @@ void KonqCombo::selectWord(QKeyEvent *e)
break;
} while( pos < (int) text.length() && chars.findIndex(text[pos]) == -1 );
if( e->state() & ShiftButton ) {
if( e->modifiers() & Qt::ShiftModifier ) {
edit->cursorForward(true, count+1);
}
else if( e->key() == Key_Delete ) {
else if( e->key() == Qt::Key_Delete ) {
edit->cursorForward(false, -count-1);
QString text = edit->text();
int pos_to_right = text.length() - pos - 1;
@ -497,7 +525,9 @@ void KonqCombo::selectWord(QKeyEvent *e)
void KonqCombo::slotCleared()
{
QByteArray data;
QDataStream s( data, IO_WriteOnly );
QDataStream s( &data, QIODevice::WriteOnly );
s.setVersion(QDataStream::Qt_3_1);
s << kapp->dcopClient()->defaultObject();
kapp->dcopClient()->send( "konqueror*", "KonquerorIface", "comboCleared(QCString)", data);
}
@ -520,10 +550,14 @@ void KonqCombo::mousePressEvent( QMouseEvent *e )
{
m_dragStart = QPoint(); // null QPoint
if ( e->button() == LeftButton && pixmap( currentItem()) ) {
if ( e->button() == Qt::LeftButton && !pixmap( currentItem()).isNull() ) {
// check if the pixmap was clicked
int x = e->pos().x();
int x0 = QStyle::visualRect( style().querySubControlMetrics( QStyle::CC_ComboBox, this, QStyle::SC_ComboBoxEditField ), this ).x();
QStyleOptionComboBox comboOpt;
getStyleOption(&comboOpt);
int x0 = QStyle::visualRect( layoutDirection(), rect(),
style()->subControlRect( QStyle::CC_ComboBox, &comboOpt, QStyle::SC_ComboBoxEditField,
this ) ).x();
if ( x > x0 + 2 && x < lineEdit()->x() ) {
m_dragStart = e->pos();
@ -531,7 +565,7 @@ void KonqCombo::mousePressEvent( QMouseEvent *e )
}
}
if ( e->button() == LeftButton && m_pageSecurity!=KonqMainWindow::NotCrypted )
if ( e->button() == Qt::LeftButton && m_pageSecurity!=KonqMainWindow::NotCrypted )
emit showPageSecurity();
KComboBox::mousePressEvent( e );
@ -543,7 +577,7 @@ void KonqCombo::mouseMoveEvent( QMouseEvent *e )
if ( m_dragStart.isNull() || currentText().isEmpty() )
return;
if ( e->state() & LeftButton &&
if ( e->state() & Qt::LeftButton &&
(e->pos() - m_dragStart).manhattanLength() >
KGlobalSettings::dndEventDelay() )
{
@ -568,7 +602,7 @@ void KonqCombo::slotActivated( const QString& text )
applyPermanent();
m_returnPressed = true;
emit activated( text, m_modifier );
m_modifier = NoButton;
m_modifier = Qt::NoButton;
}
void KonqCombo::setConfig( KConfig *kc )
@ -581,8 +615,12 @@ void KonqCombo::paintEvent( QPaintEvent *pe )
QComboBox::paintEvent( pe );
QLineEdit *edit = lineEdit();
QRect re = style().querySubControlMetrics( QStyle::CC_ComboBox, this, QStyle::SC_ComboBoxEditField );
re = QStyle::visualRect(re, this);
QStyleOptionComboBox comboOpt;
getStyleOption(&comboOpt);
QRect re = style()->subControlRect( QStyle::CC_ComboBox, &comboOpt,
QStyle::SC_ComboBoxEditField, this );
re = QStyle::visualRect(layoutDirection(), rect(), re);
if ( m_pageSecurity!=KonqMainWindow::NotCrypted ) {
QColor color(245, 246, 190);
@ -656,15 +694,16 @@ bool KonqCombo::hasSufficientContrast(const QColor &c1, const QColor &c2)
///////////////////////////////////////////////////////////////////////////////
#if 0
KonqComboListBoxPixmap::KonqComboListBoxPixmap( const QString& text )
: QListBoxItem()
: Q3ListBoxItem()
{
setText( text );
lookup_pending = true;
}
KonqComboListBoxPixmap::KonqComboListBoxPixmap( const QPixmap & pix, const QString& text, const QString& _title )
: QListBoxItem()
: Q3ListBoxItem()
{
pm = pix;
title = _title;
@ -720,7 +759,7 @@ void KonqComboListBoxPixmap::paint( QPainter *painter )
}
}
int KonqComboListBoxPixmap::height( const QListBox* lb ) const
int KonqComboListBoxPixmap::height( const Q3ListBox* lb ) const
{
int h;
if ( text().isEmpty() )
@ -730,7 +769,7 @@ int KonqComboListBoxPixmap::height( const QListBox* lb ) const
return QMAX( h, QApplication::globalStrut().height() );
}
int KonqComboListBoxPixmap::width( const QListBox* lb ) const
int KonqComboListBoxPixmap::width( const Q3ListBox* lb ) const
{
if ( text().isEmpty() )
return QMAX( pm.width() + 6, QApplication::globalStrut().width() );
@ -754,9 +793,10 @@ bool KonqComboListBoxPixmap::reuse( const QString& newText )
setText( newText );
return true;
}
#endif
///////////////////////////////////////////////////////////////////////////////
#if 0
KonqComboLineEdit::KonqComboLineEdit( QWidget *parent, const char *name )
:KLineEdit( parent, name ) {}
@ -780,7 +820,7 @@ void KonqComboLineEdit::setCompletedItems( const QStringList& items )
bool wasSelected = completionbox->isSelected( completionbox->currentItem() );
const QString currentSelection = completionbox->currentText();
completionbox->setItems( items );
QListBoxItem* item = completionbox->findItem( currentSelection, Qt::ExactMatch );
Q3ListBoxItem* item = completionbox->findItem( currentSelection, Qt::ExactMatch );
if( !item || !wasSelected )
{
wasSelected = false;
@ -811,9 +851,10 @@ void KonqComboLineEdit::setCompletedItems( const QStringList& items )
if ( completionbox && completionbox->isVisible() )
completionbox->hide();
}
#endif
///////////////////////////////////////////////////////////////////////////////
#if 0
KonqComboCompletionBox::KonqComboCompletionBox( QWidget *parent, const char *name )
:KCompletionBox( parent, name ) {}
@ -822,7 +863,7 @@ void KonqComboCompletionBox::setItems( const QStringList& items )
bool block = signalsBlocked();
blockSignals( true );
QListBoxItem* item = firstItem();
Q3ListBoxItem* item = firstItem();
if ( !item )
insertStringList( items );
else {
@ -851,7 +892,7 @@ void KonqComboCompletionBox::setItems( const QStringList& items )
if ( item )
dirty = true;
QListBoxItem* tmp = item;
Q3ListBoxItem* tmp = item;
while ( (item = tmp ) ) {
tmp = item->next();
delete item;
@ -878,5 +919,5 @@ void KonqComboCompletionBox::insertStringList( const QStringList & list, int ind
for ( QStringList::ConstIterator it = list.begin(); it != list.end(); ++it )
insertItem( new KonqComboListBoxPixmap( *it ), index++ );
}
#endif
#include "konq_combo.moc"

View file

@ -21,6 +21,11 @@
#define KONQ_COMBO_H
#include <qevent.h>
//Added by qt3to4:
#include <QPixmap>
#include <QMouseEvent>
#include <QKeyEvent>
#include <QPaintEvent>
#include <kcombobox.h>
#include <konq_historymgr.h>
@ -108,6 +113,8 @@ private:
QPoint m_dragStart;
int m_pageSecurity;
void getStyleOption(QStyleOptionComboBox* combo);
static KConfig *s_config;
static const int temporary; // the index of our temporary item
};

View file

@ -16,6 +16,10 @@
#include <qlayout.h>
#include <qtimer.h>
//Added by qt3to4:
#include <QVBoxLayout>
#include <Q3CString>
#include <Q3PtrList>
#include <kconfig.h>
#include <kdebug.h>
@ -27,9 +31,11 @@
#include <ksettings/dispatcher.h>
#include <dcopref.h>
#include "konq_view.h"
#include "konq_extensionmanager.h"
#include "konq_mainwindow.h"
class KonqExtensionManagerPrivate
{
public:
@ -53,8 +59,8 @@ KonqExtensionManager::KonqExtensionManager(QWidget *parent, KonqMainWindow *main
d->pluginSelector = new KPluginSelector(plainPage());
setMainWidget(d->pluginSelector);
connect(d->pluginSelector, SIGNAL(changed(bool)), this, SLOT(setChanged(bool)));
connect(d->pluginSelector, SIGNAL(configCommitted(const QCString &)),
KSettings::Dispatcher::self(), SLOT(reparseConfiguration(const QCString &)));
connect(d->pluginSelector, SIGNAL(configCommitted(const Q3CString &)),
KSettings::Dispatcher::self(), SLOT(reparseConfiguration(const Q3CString &)));
d->mainWindow = mainWindow;
d->activePart = activePart;
@ -101,8 +107,8 @@ void KonqExtensionManager::apply()
if( d->mainWindow )
{
KParts::Plugin::loadPlugins(d->mainWindow, d->mainWindow, KGlobal::instance());
QPtrList<KParts::Plugin> plugins = KParts::Plugin::pluginObjects(d->mainWindow);
QPtrListIterator<KParts::Plugin> it(plugins);
Q3PtrList<KParts::Plugin> plugins = KParts::Plugin::pluginObjects(d->mainWindow);
Q3PtrListIterator<KParts::Plugin> it(plugins);
KParts::Plugin *plugin;
while((plugin = it.current()) != 0)
{
@ -113,8 +119,8 @@ void KonqExtensionManager::apply()
if ( d->activePart )
{
KParts::Plugin::loadPlugins( d->activePart, d->activePart, d->activePart->instance() );
QPtrList<KParts::Plugin> plugins = KParts::Plugin::pluginObjects( d->activePart );
QPtrListIterator<KParts::Plugin> it(plugins);
Q3PtrList<KParts::Plugin> plugins = KParts::Plugin::pluginObjects( d->activePart );
Q3PtrListIterator<KParts::Plugin> it(plugins);
KParts::Plugin *plugin;
while((plugin = it.current()) != 0)
{

View file

@ -23,6 +23,7 @@
#include "konq_factory.h"
#include "version.h"
#include <konq_view.h>
#include <konq_settings.h>
#include <konq_mainwindow.h>
#include <kdebug.h>

View file

@ -20,12 +20,22 @@
#include <qpainter.h>
#include <qlayout.h>
#include <qwhatsthis.h>
#include <q3whatsthis.h>
#include <qtoolbutton.h>
#include <qtabbar.h>
#include <qptrlist.h>
#include <qpopupmenu.h>
#include <q3ptrlist.h>
#include <q3popupmenu.h>
#include <qkeysequence.h>
//Added by qt3to4:
#include <QPixmap>
#include <QPaintEvent>
#include <QChildEvent>
#include <QEvent>
#include <QKeyEvent>
#include <QLabel>
#include <QResizeEvent>
#include <QVBoxLayout>
#include <QMouseEvent>
#include <kapplication.h>
#include <kdebug.h>
@ -79,10 +89,9 @@ KonqFrameStatusBar::KonqFrameStatusBar( KonqFrame *_parent, const char *_name )
addWidget( m_pStatusLabel, 1 /*stretch*/, false ); // status label
m_pLinkedViewCheckBox = new KonqCheckBox( this, "m_pLinkedViewCheckBox" );
m_pLinkedViewCheckBox->setFocusPolicy(NoFocus);
m_pLinkedViewCheckBox->setFocusPolicy(Qt::NoFocus);
m_pLinkedViewCheckBox->setSizePolicy(QSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed ));
QWhatsThis::add( m_pLinkedViewCheckBox,
i18n("Checking this box on at least two views sets those views as 'linked'. "
m_pLinkedViewCheckBox->setWhatsThis( i18n("Checking this box on at least two views sets those views as 'linked'. "
"Then, when you change directories in one view, the other views "
"linked with it will automatically update to show the current directory. "
"This is especially useful with different types of views, such as a "
@ -153,7 +162,7 @@ void KonqFrameStatusBar::splitFrameMenu()
// ###### might be not right for passive views !
KActionCollection *actionColl = mw->actionCollection();
QPopupMenu menu;
Q3PopupMenu menu;
actionColl->action( "splitviewh" )->plug( &menu );
actionColl->action( "splitviewv" )->plug( &menu );
@ -171,7 +180,7 @@ bool KonqFrameStatusBar::eventFilter(QObject* o, QEvent *e)
{
emit clicked();
update();
if ( static_cast<QMouseEvent *>(e)->button() == RightButton)
if ( static_cast<QMouseEvent *>(e)->button() == Qt::RightButton)
splitFrameMenu();
return true;
}
@ -392,7 +401,7 @@ bool KonqFrame::eventFilter(QObject* /*obj*/, QEvent *ev)
if (ev->type()==QEvent::KeyPress)
{
QKeyEvent * keyEv = static_cast<QKeyEvent*>(ev);
if ((keyEv->key()==Key_Tab) && (keyEv->state()==ControlButton))
if ((keyEv->key()==Qt::Key_Tab) && (keyEv->modifiers()==Qt::ControlButton))
{
emit ((KonqFrameContainer*)parent())->ctrlTabPressed();
return true;
@ -477,7 +486,7 @@ void KonqFrameContainerBase::printFrameInfo(const QString& spaces)
//###################################################################
KonqFrameContainer::KonqFrameContainer( Orientation o,
KonqFrameContainer::KonqFrameContainer( Qt::Orientation o,
QWidget* parent,
KonqFrameContainerBase* parentContainer,
const char * name)
@ -488,6 +497,8 @@ KonqFrameContainer::KonqFrameContainer( Orientation o,
m_pSecondChild = 0L;
m_pActiveChild = 0L;
setOpaqueResize( KGlobalSettings::opaqueResize() );
connect(this, SIGNAL(splitterMoved(int, int)), this, SIGNAL(setRubberbandCalled()));
//### CHECKME
}
KonqFrameContainer::~KonqFrameContainer()
@ -539,13 +550,13 @@ void KonqFrameContainer::saveConfig( KConfig* config, const QString &prefix, boo
//write child configs
if( firstChild() ) {
QString newPrefix = QString::fromLatin1( firstChild()->frameType() ) + QString::number(idSecond - 1);
newPrefix.append( '_' );
newPrefix.append( QLatin1Char( '_' ) );
firstChild()->saveConfig( config, newPrefix, saveURLs, docContainer, id, depth + 1 );
}
if( secondChild() ) {
QString newPrefix = QString::fromLatin1( secondChild()->frameType() ) + QString::number( idSecond );
newPrefix.append( '_' );
newPrefix.append( QLatin1Char( '_' ) );
secondChild()->saveConfig( config, newPrefix, saveURLs, docContainer, idSecond, depth + 1 );
}
}
@ -659,10 +670,6 @@ void KonqFrameContainer::childEvent( QChildEvent *c )
QSplitter::childEvent(c);
}
void KonqFrameContainer::setRubberband( int pos )
{
emit setRubberbandCalled();
QSplitter::setRubberband( pos );
}
//emit s;
#include "konq_frame.moc"

View file

@ -21,12 +21,23 @@
#include "konq_factory.h"
#include <qguardedptr.h>
#include <qpointer.h>
#include <qcolor.h>
#include <qwidget.h>
#include <qsplitter.h>
#include <qcheckbox.h>
#include <qlabel.h>
//Added by qt3to4:
#include <QPixmap>
#include <Q3CString>
#include <QPaintEvent>
#include <QChildEvent>
#include <Q3PtrList>
#include <QEvent>
#include <QHBoxLayout>
#include <QVBoxLayout>
#include <QResizeEvent>
#include <QMouseEvent>
#include <kpixmap.h>
#include <kpixmapeffect.h>
@ -147,7 +158,7 @@ class KonqFrameStatusBar : public KStatusBar
};
typedef QPtrList<KonqView> ChildViewList;
typedef Q3PtrList<KonqView> ChildViewList;
class KonqFrameBase
{
@ -172,7 +183,7 @@ class KonqFrameBase
virtual QWidget* widget() = 0;
virtual void listViews( ChildViewList *viewList ) = 0;
virtual QCString frameType() = 0;
virtual Q3CString frameType() = 0;
virtual void activateChild() = 0;
@ -255,7 +266,7 @@ public:
//virtual KonqFrameContainerBase* parentContainer();
virtual QWidget* widget() { return this; }
virtual QCString frameType() { return QCString("View"); }
virtual Q3CString frameType() { return Q3CString("View"); }
QVBoxLayout *layout()const { return m_pLayout; }
@ -285,9 +296,9 @@ protected:
virtual void paintEvent( QPaintEvent* );
QVBoxLayout *m_pLayout;
QGuardedPtr<KonqView> m_pView;
QPointer<KonqView> m_pView;
QGuardedPtr<KParts::ReadOnlyPart> m_pPart;
QPointer<KParts::ReadOnlyPart> m_pPart;
KonqViewManager* m_pViewManager;
@ -314,7 +325,7 @@ public:
//inherited
virtual void printFrameInfo( const QString& spaces );
virtual QCString frameType() { return QCString("ContainerBase"); }
virtual Q3CString frameType() { return Q3CString("ContainerBase"); }
virtual void reparentFrame(QWidget * parent,
const QPoint & p, bool showIt=FALSE ) = 0;
@ -349,7 +360,7 @@ class KonqFrameContainer : public QSplitter, public KonqFrameContainerBase
Q_OBJECT
friend class KonqFrame; //for emitting ctrlTabPressed() only, aleXXX
public:
KonqFrameContainer( Orientation o,
KonqFrameContainer( Qt::Orientation o,
QWidget* parent,
KonqFrameContainerBase* parentContainer,
const char * name = 0);
@ -372,7 +383,7 @@ public:
virtual void setTabIcon( const QString &url, QWidget* sender );
virtual QWidget* widget() { return this; }
virtual QCString frameType() { return QCString("Container"); }
virtual Q3CString frameType() { return Q3CString("Container"); }
/**
* Call this after inserting a new frame into the splitter.
@ -388,7 +399,7 @@ public:
const QPoint & p, bool showIt=FALSE );
//make this one public
int idAfter( QWidget* w ){ return QSplitter::idAfter( w ); }
int idAfter( QWidget* w ){ return QSplitter::indexOf( w ) + 1; }
void setAboutToBeDeleted() { m_bAboutToBeDeleted = true; }
@ -400,8 +411,6 @@ signals:
void setRubberbandCalled();
protected:
virtual void setRubberband( int );
KonqFrameBase* m_pFirstChild;
KonqFrameBase* m_pSecondChild;
bool m_bAboutToBeDeleted;

View file

@ -26,6 +26,10 @@
#include "konq_guiclients.h"
#include "konq_viewmgr.h"
#include <kiconloader.h>
//Added by qt3to4:
#include <Q3ValueList>
#include <Q3CString>
#include <Q3PtrList>
PopupMenuGUIClient::PopupMenuGUIClient( KonqMainWindow *mainWindow,
const KTrader::OfferList &embeddingServices,
@ -144,7 +148,7 @@ void PopupMenuGUIClient::addEmbeddingService( QDomElement &menu, int idx, const
QDomElement action = m_doc.createElement( "action" );
menu.appendChild( action );
QCString actName;
Q3CString actName;
actName.setNum( idx );
action.setAttribute( "name", QString::number( idx ) );
@ -217,11 +221,11 @@ ToggleViewGUIClient::~ToggleViewGUIClient()
{
}
QPtrList<KAction> ToggleViewGUIClient::actions() const
Q3PtrList<KAction> ToggleViewGUIClient::actions() const
{
QPtrList<KAction> res;
Q3PtrList<KAction> res;
QDictIterator<KAction> it( m_actions );
Q3DictIterator<KAction> it( m_actions );
for (; it.current(); ++it )
res.append( it.current() );
@ -244,7 +248,7 @@ void ToggleViewGUIClient::slotToggleView( bool toggle )
serviceName,
!horizontal /* vertical = make it first */);
QValueList<int> newSplitterSizes;
Q3ValueList<int> newSplitterSizes;
if ( horizontal )
newSplitterSizes << 100 << 30;
@ -282,11 +286,11 @@ void ToggleViewGUIClient::slotToggleView( bool toggle )
}
else
{
QPtrList<KonqView> viewList;
Q3PtrList<KonqView> viewList;
m_mainWindow->listViews( &viewList );
QPtrListIterator<KonqView> it( viewList );
Q3PtrListIterator<KonqView> it( viewList );
for (; it.current(); ++it )
if ( it.current()->service()->desktopEntryName() == serviceName )
// takes care of choosing the new active view, and also calls slotViewRemoved

View file

@ -22,7 +22,9 @@
#include <kxmlguiclient.h>
#include <qobject.h>
#include <qdict.h>
#include <q3dict.h>
//Added by qt3to4:
#include <Q3PtrList>
#include <ktrader.h>
class KAction;
@ -78,7 +80,7 @@ public:
bool empty() const { return m_empty; }
QPtrList<KAction> actions() const;
Q3PtrList<KAction> actions() const;
KAction *action( const QString &name ) { return m_actions[ name ]; }
void saveConfig( bool add, const QString &serviceName );
@ -89,7 +91,7 @@ private slots:
void slotViewRemoved( KonqView *view );
private:
KonqMainWindow *m_mainWindow;
QDict<KAction> m_actions;
Q3Dict<KAction> m_actions;
bool m_empty;
QMap<QString,bool> m_mapOrientation;
};

View file

@ -34,7 +34,8 @@
#include <kimageio.h>
#include <qfile.h>
#include <qwidgetlist.h>
#include <qwidget.h>
#include <QX11Info>
static const KCmdLineOptions options[] =
{
@ -132,8 +133,9 @@ extern "C" KDE_EXPORT int kdemain( int argc, char **argv )
if( KonqSettings::maxPreloadCount() > 0 )
{
DCOPRef ref( "kded", "konqy_preloader" );
QX11Info info;
if( !ref.callExt( "registerPreloadedKonqy", DCOPRef::NoEventLoop, 5000,
app.dcopClient()->appId(), qt_xscreen()))
app.dcopClient()->appId(), info.screen()))
return 0; // too many preloaded or failed
KonqMainWindow* win = new KonqMainWindow( KURL(), false ); // prepare an empty window too
// KonqMainWindow ctor sets always the preloaded flag to false, so create the window before this

View file

@ -62,10 +62,22 @@
#include <qfile.h>
#include <qclipboard.h>
#include <qmetaobject.h>
#include <qvbox.h>
#include <q3vbox.h>
#include <qlayout.h>
#include <qfileinfo.h>
#include <qwhatsthis.h>
#include <q3whatsthis.h>
#include <QX11Info>
//Added by qt3to4:
#include <QCustomEvent>
#include <QFocusEvent>
#include <Q3StrList>
#include <QKeyEvent>
#include <QEvent>
#include <Q3CString>
#include <Q3ValueList>
#include <Q3PtrList>
#include <QCloseEvent>
#include <QPixmap>
#include <dcopclient.h>
#include <kaboutdata.h>
@ -117,10 +129,10 @@
#include <X11/Xatom.h>
#include <fixx11h.h>
template class QPtrList<QPixmap>;
template class QPtrList<KToggleAction>;
template class Q3PtrList<QPixmap>;
template class Q3PtrList<KToggleAction>;
QPtrList<KonqMainWindow> *KonqMainWindow::s_lstViews = 0;
Q3PtrList<KonqMainWindow> *KonqMainWindow::s_lstViews = 0;
KConfig * KonqMainWindow::s_comboConfig = 0;
KCompletion * KonqMainWindow::s_pCompletion = 0;
QFile * KonqMainWindow::s_crashlog_file = 0;
@ -142,12 +154,12 @@ KonqExtendedBookmarkOwner::KonqExtendedBookmarkOwner(KonqMainWindow *w)
}
KonqMainWindow::KonqMainWindow( const KURL &initialURL, bool openInitialURL, const char *name, const QString& xmluiFile)
: KParts::MainWindow( NoDCOPObject, 0L, name, WDestructiveClose | WStyle_ContextHelp )
: KParts::MainWindow( NoDCOPObject, 0L, name, Qt::WDestructiveClose | Qt::WStyle_ContextHelp )
{
setPreloadedFlag( false );
if ( !s_lstViews )
s_lstViews = new QPtrList<KonqMainWindow>;
s_lstViews = new Q3PtrList<KonqMainWindow>;
s_lstViews->append( this );
@ -240,10 +252,10 @@ KonqMainWindow::KonqMainWindow( const KURL &initialURL, bool openInitialURL, con
}
// Those menus are created by konqueror.rc so their address will never change
QPopupMenu *popup = static_cast<QPopupMenu*>(factory()->container("edit",this));
Q3PopupMenu *popup = static_cast<Q3PopupMenu*>(factory()->container("edit",this));
if (popup)
KAcceleratorManager::manage(popup);
popup = static_cast<QPopupMenu*>(factory()->container("tools",this));
popup = static_cast<Q3PopupMenu*>(factory()->container("tools",this));
if (popup)
KAcceleratorManager::manage(popup);
@ -376,8 +388,8 @@ void KonqMainWindow::initBookmarkBar()
delete m_paBookmarkBar;
m_paBookmarkBar = new KBookmarkBar( KonqBookmarkManager::self(), m_pBookmarksOwner, bar, m_bookmarkBarActionCollection, this );
connect( m_paBookmarkBar,
SIGNAL( aboutToShowContextMenu(const KBookmark &, QPopupMenu*) ),
this, SLOT( slotFillContextMenu(const KBookmark &, QPopupMenu*) ));
SIGNAL( aboutToShowContextMenu(const KBookmark &, Q3PopupMenu*) ),
this, SLOT( slotFillContextMenu(const KBookmark &, Q3PopupMenu*) ));
connect( m_paBookmarkBar,
SIGNAL( openBookmark(const QString &, Qt::ButtonState) ),
this, SLOT( slotOpenBookmarkURL(const QString &, Qt::ButtonState) ));
@ -550,7 +562,7 @@ void KonqMainWindow::openURL( KonqView *_view, const KURL &_url,
// Fast mode for local files: do the stat ourselves instead of letting KRun do it.
if ( serviceType.isEmpty() && url.isLocalFile() )
{
QCString _path( QFile::encodeName(url.path()));
Q3CString _path( QFile::encodeName(url.path()));
KDE_struct_stat buff;
if ( KDE_stat( _path.data(), &buff ) != -1 )
serviceType = KMimeType::findByURL( url, buff.st_mode )->name();
@ -755,7 +767,7 @@ bool KonqMainWindow::openView( QString serviceType, const KURL &_url, KonqView *
urlDotDir.addPath(".directory");
bool HTMLAllowed = m_bHTMLAllowed;
QFile f( urlDotDir.path() );
if ( f.open(IO_ReadOnly) )
if ( f.open(QIODevice::ReadOnly) )
{
f.close();
KSimpleConfig config( urlDotDir.path(), true );
@ -996,7 +1008,7 @@ bool KonqMainWindow::makeViewsFollow( const KURL & url, const KParts::URLArgs &a
req.args = args;
// We can't iterate over the map here, and openURL for each, because the map can get modified
// (e.g. by part changes). Better copy the views into a list.
QPtrList<KonqView> listViews;
Q3PtrList<KonqView> listViews;
MapViews::ConstIterator it = m_mapViews.begin();
MapViews::ConstIterator end = m_mapViews.end();
for (; it != end; ++it )
@ -1076,7 +1088,7 @@ void KonqMainWindow::slotCreateNewWindow( const KURL &url, const KParts::URLArgs
req.newTabInFront = KonqSettings::newTabsInFront();
req.openAfterCurrentPage = KonqSettings::openAfterCurrentPage();
if (KApplication::keyboardMouseState() & Qt::ShiftButton)
if (KApplication::keyboardMouseState() & Qt::ShiftModifier)
req.newTabInFront = !req.newTabInFront;
req.args = args;
openURL( 0L, url, QString::null, req );
@ -1102,9 +1114,9 @@ void KonqMainWindow::slotCreateNewWindow( const KURL &url, const KParts::URLArgs
{
KParts::BrowserHostExtension *hostExtension = 0;
KParts::ReadOnlyPart *ro_part = 0L;
KParts::BrowserExtension *be = ::qt_cast<KParts::BrowserExtension *>(sender());
KParts::BrowserExtension *be = ::qobject_cast<KParts::BrowserExtension *>(sender());
if (be)
ro_part = ::qt_cast<KParts::ReadOnlyPart *>(be->parent());
ro_part = ::qobject_cast<KParts::ReadOnlyPart *>(be->parent());
if ( findChildView( ro_part, args.frameName, &mainWindow, &hostExtension, &part ) )
{
// Found a view. If url isn't empty, we should open it - but this never happens currently
@ -1200,10 +1212,8 @@ void KonqMainWindow::slotCreateNewWindow( const KURL &url, const KParts::URLArgs
if ( !windowArgs.toolBarsVisible )
{
for ( QPtrListIterator<KToolBar> it( mainWindow->toolBarIterator() ); it.current(); ++it )
{
(*it)->hide();
}
foreach (KToolBar* bar, mainWindow->toolBarList())
bar->hide();
}
if ( view ) {
@ -1223,18 +1233,18 @@ void KonqMainWindow::slotCreateNewWindow( const KURL &url, const KParts::URLArgs
// well. If the WM has support for _NET_WM_USER_TIME, it will be just set to 0 (=don't focus on show),
// and the WM should take care of it itself.
bool wm_usertime_support = false;
extern Time qt_x_user_time;
Time saved_last_input_time = qt_x_user_time;
Time saved_last_input_time = QX11Info::appUserTime();
if ( windowArgs.lowerWindow )
{
NETRootInfo wm_info( qt_xdisplay(), NET::Supported );
NETRootInfo wm_info( QX11Info::display(), NET::Supported );
wm_usertime_support = wm_info.isSupported( NET::WM2UserTime );
if( wm_usertime_support )
{
// *sigh*, and I thought nobody would need QWidget::dontFocusOnShow().
// Avoid Qt's support for user time by setting it to 0, and
// set the property ourselves.
qt_x_user_time = 0;
QX11Info::setAppUserTime( 0 );
KWin::setUserTime( mainWindow->winId(), 0 );
}
// Put below the current window before showing, in case that actually works with the WM.
@ -1247,7 +1257,7 @@ void KonqMainWindow::slotCreateNewWindow( const KURL &url, const KParts::URLArgs
if ( windowArgs.lowerWindow )
{
qt_x_user_time = saved_last_input_time;
QX11Info::setAppUserTime( saved_last_input_time );
if( !wm_usertime_support )
{ // No WM support. Let's try ugly tricks.
mainWindow->lower();
@ -1337,7 +1347,7 @@ void KonqMainWindow::slotSendFile()
QDir().mkdir(zipFileName,true);
zipFileName = zipFileName+"/"+(*it).fileName()+".zip";
KZip zip( zipFileName );
if ( !zip.open( IO_WriteOnly ) )
if ( !zip.open( QIODevice::WriteOnly ) )
continue; // TODO error message
zip.addLocalDirectory( (*it).path(), QString::null );
zip.close();
@ -1576,7 +1586,7 @@ void KonqMainWindow::slotViewModeToggle( bool toggle )
// quick viewmode change (iconview) -> find the iconview-konqviewmode
// action and set new text,icon,etc. properties, to show the new
// current viewmode
QPtrListIterator<KAction> it( m_toolBarViewModeActions );
Q3PtrListIterator<KAction> it( m_toolBarViewModeActions );
for (; it.current(); ++it )
if ( QString::fromLatin1( it.current()->name() ) == oldService->desktopEntryName() )
{
@ -1741,7 +1751,7 @@ void KonqMainWindow::slotReload( KonqView* reloadView )
if ( !reloadView || reloadView->url().isEmpty() )
return;
if ( reloadView->part() && (reloadView->part()->metaObject()->findProperty("modified") != -1) ) {
if ( reloadView->part() && (reloadView->part()->metaObject()->indexOfProperty("modified") != -1) ) {
QVariant prop = reloadView->part()->property("modified");
if (prop.isValid() && prop.toBool())
if ( KMessageBox::warningContinueCancel( this,
@ -1777,10 +1787,10 @@ void KonqMainWindow::slotHome(KAction::ActivationReason, Qt::ButtonState state)
req.newTab = true;
req.newTabInFront = KonqSettings::newTabsInFront();
if (state & Qt::ShiftButton)
if (state & Qt::ShiftModifier)
req.newTabInFront = !req.newTabInFront;
if( state & Qt::ControlButton ) // Ctrl Left/MMB
if( state & Qt::ControlModifier ) // Ctrl Left/MMB
openFilteredURL( homeURL, req);
else if( state & Qt::MidButton )
{
@ -1935,7 +1945,7 @@ void KonqMainWindow::slotUndoAvailable( bool avail )
if ( avail && m_currentView && m_currentView->part() )
{
// Avoid qWarning from QObject::property if it doesn't exist
if ( m_currentView->part()->metaObject()->findProperty( "supportsUndo" ) != -1 )
if ( m_currentView->part()->metaObject()->indexOfProperty( "supportsUndo" ) != -1 )
{
QVariant prop = m_currentView->part()->property( "supportsUndo" );
if ( prop.isValid() && prop.toBool() )
@ -1978,7 +1988,9 @@ void KonqMainWindow::slotRunFinished()
if ( run->hasError() ) { // we had an error
QByteArray data;
QDataStream s( data, IO_WriteOnly );
QDataStream s( &data, QIODevice::WriteOnly );
s.setVersion(QDataStream::Qt_3_1);
s << run->url().prettyURL() << kapp->dcopClient()->defaultObject();
kapp->dcopClient()->send( "konqueror*", "KonquerorIface",
"removeFromCombo(QString,QCString)", data);
@ -2129,7 +2141,7 @@ void KonqMainWindow::slotPartActivated( KParts::Part *part )
for ( ; it != itEnd ; ++it )
{
KAction * act = actionCollection()->action( it.key() );
KAction * act = actionCollection()->action( it.key().data() );
Q_ASSERT(act);
if (act)
act->setEnabled( false );
@ -2161,7 +2173,7 @@ void KonqMainWindow::slotPartActivated( KParts::Part *part )
// if we just toggled the view mode via the view mode actions, then
// we don't need to do all the time-taking stuff below (Simon)
const QString currentServiceDesktopEntryName = m_currentView->service()->desktopEntryName();
QPtrListIterator<KRadioAction> it( m_viewModeActions );
Q3PtrListIterator<KRadioAction> it( m_viewModeActions );
for (; it.current(); ++it ) {
if ( it.current()->name() == currentServiceDesktopEntryName ) {
it.current()->setChecked( true );
@ -2169,7 +2181,7 @@ void KonqMainWindow::slotPartActivated( KParts::Part *part )
}
}
const QString currentServiceLibrary = viewModeActionKey( m_currentView->service() );
QPtrListIterator<KAction> ittb( m_toolBarViewModeActions );
Q3PtrListIterator<KAction> ittb( m_toolBarViewModeActions );
for (; ittb.current(); ++ittb ) {
KService::Ptr serv = KService::serviceByDesktopName( ittb.current()->name() );
if ( serv && viewModeActionKey( serv ) == currentServiceLibrary ) {
@ -2347,8 +2359,8 @@ KonqView * KonqMainWindow::childView( KParts::ReadOnlyPart *callingPart, const Q
if ( ext )
{
QPtrList<KParts::ReadOnlyPart> frames = ext->frames();
QPtrListIterator<KParts::ReadOnlyPart> frameIt( frames );
Q3PtrList<KParts::ReadOnlyPart> frames = ext->frames();
Q3PtrListIterator<KParts::ReadOnlyPart> frameIt( frames );
for ( ; frameIt.current() ; ++frameIt )
{
if ( frameIt.current()->name() == name )
@ -2373,7 +2385,7 @@ KonqView * KonqMainWindow::findChildView( KParts::ReadOnlyPart *callingPart, con
if ( !s_lstViews )
return 0;
QPtrListIterator<KonqMainWindow> it( *s_lstViews );
Q3PtrListIterator<KonqMainWindow> it( *s_lstViews );
for (; it.current(); ++it )
{
KonqView *res = it.current()->childView( callingPart, name, hostExtension, part );
@ -2495,7 +2507,7 @@ void KonqMainWindow::slotURLEntered( const QString &text, int state )
m_bURLEnterLock = true;
if (state & ControlButton || state & AltButton)
if (state & Qt::ControlModifier || state & Qt::AltModifier)
{
m_combo->setURL( m_currentView ? m_currentView->url().prettyURL() : QString::null );
openFilteredURL( text.stripWhiteSpace(), true );
@ -2554,7 +2566,7 @@ void KonqMainWindow::slotDuplicateTabPopup()
void KonqMainWindow::slotBreakOffTab()
{
if (m_currentView && m_currentView->part() &&
(m_currentView->part()->metaObject()->findProperty("modified") != -1) ) {
(m_currentView->part()->metaObject()->indexOfProperty("modified") != -1) ) {
QVariant prop = m_currentView->part()->property("modified");
if (prop.isValid() && prop.toBool())
if ( KMessageBox::warningContinueCancel( this,
@ -2571,7 +2583,7 @@ void KonqMainWindow::slotBreakOffTabPopup()
{
KonqView* originalView = m_currentView;
KonqView *view = m_pWorkingTab->activeChildView();
if (view && view->part() && (view->part()->metaObject()->findProperty("modified") != -1) ) {
if (view && view->part() && (view->part()->metaObject()->indexOfProperty("modified") != -1) ) {
QVariant prop = view->part()->property("modified");
if (prop.isValid() && prop.toBool()) {
m_pViewManager->showTab( view );
@ -2630,7 +2642,7 @@ void KonqMainWindow::slotPopupNewTabRight()
{
bool newTabsInFront = KonqSettings::newTabsInFront();
if (KApplication::keyboardMouseState() & ShiftButton)
if (KApplication::keyboardMouseState() & Qt::ShiftModifier)
newTabsInFront = !newTabsInFront;
popupNewTab(newTabsInFront, false);
@ -2676,7 +2688,7 @@ void KonqMainWindow::openMultiURL( KURL::List url )
void KonqMainWindow::slotRemoveView()
{
if (m_currentView && m_currentView->part() &&
(m_currentView->part()->metaObject()->findProperty("modified") != -1) ) {
(m_currentView->part()->metaObject()->indexOfProperty("modified") != -1) ) {
QVariant prop = m_currentView->part()->property("modified");
if (prop.isValid() && prop.toBool())
if ( KMessageBox::warningContinueCancel( this,
@ -2692,7 +2704,7 @@ void KonqMainWindow::slotRemoveView()
void KonqMainWindow::slotRemoveTab()
{
if (m_currentView && m_currentView->part() &&
(m_currentView->part()->metaObject()->findProperty("modified") != -1) ) {
(m_currentView->part()->metaObject()->indexOfProperty("modified") != -1) ) {
QVariant prop = m_currentView->part()->property("modified");
if (prop.isValid() && prop.toBool())
if ( KMessageBox::warningContinueCancel( this,
@ -2708,7 +2720,7 @@ void KonqMainWindow::slotRemoveTabPopup()
{
KonqView *originalView = m_currentView;
KonqView *view = m_pWorkingTab->activeChildView();
if (view && view->part() && (view->part()->metaObject()->findProperty("modified") != -1) ) {
if (view && view->part() && (view->part()->metaObject()->indexOfProperty("modified") != -1) ) {
QVariant prop = view->part()->property("modified");
if (prop.isValid() && prop.toBool()) {
m_pViewManager->showTab( view );
@ -2745,7 +2757,7 @@ void KonqMainWindow::slotRemoveOtherTabsPopup()
MapViews::ConstIterator end = m_mapViews.end();
for (; it != end; ++it ) {
KonqView *view = it.data();
if ( view != originalView && view && view->part() && (view->part()->metaObject()->findProperty("modified") != -1) ) {
if ( view != originalView && view && view->part() && (view->part()->metaObject()->indexOfProperty("modified") != -1) ) {
QVariant prop = view->part()->property("modified");
if (prop.isValid() && prop.toBool()) {
m_pViewManager->showTab( view );
@ -2778,7 +2790,7 @@ void KonqMainWindow::slotReloadAllTabs()
MapViews::ConstIterator end = m_mapViews.end();
for (; it != end; ++it ) {
KonqView *view = it.data();
if (view && view->part() && (view->part()->metaObject()->findProperty("modified") != -1) ) {
if (view && view->part() && (view->part()->metaObject()->indexOfProperty("modified") != -1) ) {
QVariant prop = view->part()->property("modified");
if (prop.isValid() && prop.toBool()) {
m_pViewManager->showTab( view );
@ -2843,7 +2855,7 @@ void KonqMainWindow::slotRemoveLocalProperties()
if ( u.isLocalFile() )
{
QFile f( u.path() );
if ( f.open(IO_ReadWrite) )
if ( f.open(QIODevice::ReadWrite) )
{
f.close();
KSimpleConfig config( u.path() );
@ -2966,7 +2978,7 @@ void KonqMainWindow::slotSaveViewProfile()
void KonqMainWindow::slotUpAboutToShow()
{
QPopupMenu *popup = m_paUp->popupMenu();
Q3PopupMenu *popup = m_paUp->popupMenu();
popup->clear();
@ -2978,7 +2990,7 @@ void KonqMainWindow::slotUpAboutToShow()
u = u.upURL();
while ( u.hasPath() )
{
popup->insertItem( KonqPixmapProvider::self()->pixmapFor( u.url() ),
popup->insertItem( QIcon( KonqPixmapProvider::self()->pixmapFor( u.url() ) ),
u.pathOrURL() );
if ( u.path() == "/" )
@ -3333,7 +3345,7 @@ bool KonqMainWindow::eventFilter(QObject*obj,QEvent *ev)
//kdDebug(1202) << "KonqMainWindow::eventFilter " << obj << " " << obj->className() << " " << obj->name() << endl;
QFocusEvent * focusEv = static_cast<QFocusEvent*>(ev);
if (focusEv->reason() == QFocusEvent::Popup)
if (focusEv->reason() == Qt::PopupFocusReason)
{
return KParts::MainWindow::eventFilter( obj, ev );
}
@ -3341,9 +3353,10 @@ bool KonqMainWindow::eventFilter(QObject*obj,QEvent *ev)
KParts::BrowserExtension * ext = 0;
if ( m_currentView )
ext = m_currentView->browserExtension();
QStrList slotNames;
const QMetaObject* slotMetaObject = 0;
if (ext)
slotNames = ext->metaObject()->slotNames();
slotMetaObject = ext->metaObject();
//for ( char * s = slotNames.first() ; s ; s = slotNames.next() )
//{
@ -3366,16 +3379,16 @@ bool KonqMainWindow::eventFilter(QObject*obj,QEvent *ev)
// prevents the lineedit from getting this event. IMHO the accel
// should be disabled in favor of the focus-widget.
KAction *duplicate = actionCollection()->action("duplicate_window");
if ( duplicate->shortcut() == QKeySequence(CTRL+Key_D) )
if ( duplicate->shortcut() == QKeySequence(Qt::CTRL+Qt::Key_D) )
duplicate->setEnabled( false );
if (slotNames.contains("cut()"))
if (slotMetaObject && slotMetaObject->indexOfSlot("cut()") != -1)
disconnect( m_paCut, SIGNAL( activated() ), ext, SLOT( cut() ) );
if (slotNames.contains("copy()"))
if (slotMetaObject && slotMetaObject->indexOfSlot("copy()") != -1)
disconnect( m_paCopy, SIGNAL( activated() ), ext, SLOT( copy() ) );
if (slotNames.contains("paste()"))
if (slotMetaObject && slotMetaObject->indexOfSlot("paste()") != -1)
disconnect( m_paPaste, SIGNAL( activated() ), ext, SLOT( paste() ) );
if (slotNames.contains("del()"))
if (slotMetaObject && slotMetaObject->indexOfSlot("del()") != -1)
disconnect( m_paDelete, SIGNAL( activated() ), ext, SLOT( del() ) );
disconnect( m_paTrash, SIGNAL( activated( KAction::ActivationReason, Qt::ButtonState ) ),
this, SLOT( slotTrashActivated( KAction::ActivationReason, Qt::ButtonState ) ) );
@ -3407,16 +3420,16 @@ bool KonqMainWindow::eventFilter(QObject*obj,QEvent *ev)
// we use new_window as reference, as it's always in the same state
// as duplicate_window
KAction *duplicate = actionCollection()->action("duplicate_window");
if ( duplicate->shortcut() == QKeySequence(CTRL+Key_D) )
if ( duplicate->shortcut() == QKeySequence(Qt::CTRL+Qt::Key_D) )
duplicate->setEnabled( actionCollection()->action("new_window")->isEnabled() );
if (slotNames.contains("cut()"))
if (slotMetaObject && slotMetaObject->indexOfSlot("cut()") != -1)
connect( m_paCut, SIGNAL( activated() ), ext, SLOT( cut() ) );
if (slotNames.contains("copy()"))
if (slotMetaObject && slotMetaObject->indexOfSlot("copy()") != -1)
connect( m_paCopy, SIGNAL( activated() ), ext, SLOT( copy() ) );
if (slotNames.contains("paste()"))
if (slotMetaObject && slotMetaObject->indexOfSlot("paste()") != -1)
connect( m_paPaste, SIGNAL( activated() ), ext, SLOT( paste() ) );
if (slotNames.contains("del()"))
if (slotMetaObject && slotMetaObject->indexOfSlot("del()") != -1)
connect( m_paDelete, SIGNAL( activated() ), ext, SLOT( del() ) );
connect( m_paTrash, SIGNAL( activated( KAction::ActivationReason, Qt::ButtonState ) ),
this, SLOT( slotTrashActivated( KAction::ActivationReason, Qt::ButtonState ) ) );
@ -3505,12 +3518,11 @@ void KonqMainWindow::slotUpdateFullScreen( bool set )
bool haveFullScreenButton = false;
//Walk over the toolbars and check whether there is a show fullscreen button in any of them
QPtrListIterator<KToolBar> barIt = toolBarIterator();
for (; barIt.current(); ++barIt )
foreach (KToolBar* bar, toolBarList())
{
//Are we plugged here, in a visible toolbar?
if (barIt.current()->isVisible() &&
action( "fullscreen" )->isPlugged(barIt.current()))
if (bar->isVisible() &&
action( "fullscreen" )->isPlugged(bar))
{
haveFullScreenButton = true;
break;
@ -3519,7 +3531,7 @@ void KonqMainWindow::slotUpdateFullScreen( bool set )
if (!haveFullScreenButton)
{
QPtrList<KAction> lst;
Q3PtrList<KAction> lst;
lst.append( m_ptaFullScreen );
plugActionList( "fullscreen", lst );
}
@ -3529,16 +3541,19 @@ void KonqMainWindow::slotUpdateFullScreen( bool set )
// Qt bug, the flags are lost. They know about it.
// happens only with the hackish non-_NET_WM_STATE_FULLSCREEN way
setWFlags( WDestructiveClose );
setAttribute( Qt::WA_DeleteOnClose );
// Qt bug (see below)
//### KDE4: still relevant?
#if 0
setAcceptDrops( FALSE );
topData()->dnd = 0;
setAcceptDrops( TRUE );
#endif
}
else
{
#if QT_VERSION >= 0x030300
setWindowState( windowState() & ~WindowFullScreen );
setWindowState( windowState() & ~Qt::WindowFullScreen );
#else
if( isMaximized())
{
@ -3553,11 +3568,19 @@ void KonqMainWindow::slotUpdateFullScreen( bool set )
menuBar()->show(); // maybe we should store this setting instead of forcing it
// Qt bug, the flags aren't restored. They know about it.
setWFlags( WType_TopLevel | WDestructiveClose );
//setWFlags( WType_TopLevel | WDestructiveClose );
#ifdef __GNUC__
#warning "Dunno how to port this, is the workaround still needed?"
#endif
( Qt::Window );
setAttribute( Qt::WA_DeleteOnClose );
#if 0 //### KDE4: is this still relevant?
// Other Qt bug
setAcceptDrops( FALSE );
topData()->dnd = 0;
setAcceptDrops( TRUE );
#endif
}
}
@ -3592,7 +3615,7 @@ void KonqMainWindow::showPageSecurity()
}
// called via DCOP from KonquerorIface
void KonqMainWindow::comboAction( int action, const QString& url, const QCString& objId )
void KonqMainWindow::comboAction( int action, const QString& url, const Q3CString& objId )
{
if (!s_lstViews) // this happens in "konqueror --silent"
return;
@ -3621,7 +3644,7 @@ void KonqMainWindow::comboAction( int action, const QString& url, const QCString
}
// only one instance should save...
if ( combo && objId == kapp->dcopClient()->defaultObject() )
if ( combo && DCOPCString(objId) == kapp->dcopClient()->defaultObject() )
combo->saveItems();
}
@ -3679,14 +3702,14 @@ void KonqMainWindow::initActions()
this, SLOT(slotFileNewAboutToShow()) );
(void) new KAction( i18n( "&Edit File Type..." ), 0, actionCollection(), "editMimeType" );
(void) new KAction( i18n( "Properties" ), ALT+Key_Return, actionCollection(), "properties" );
(void) new KAction( i18n( "Properties" ), Qt::ALT+Qt::Key_Return, actionCollection(), "properties" );
(void) new KAction( i18n( "New &Window" ), "window_new", KStdAccel::shortcut(KStdAccel::New), this, SLOT( slotNewWindow() ), actionCollection(), "new_window" );
(void) new KAction( i18n( "&Duplicate Window" ), "window_new", CTRL+Key_D, this, SLOT( slotDuplicateWindow() ), actionCollection(), "duplicate_window" );
(void) new KAction( i18n( "&Duplicate Window" ), "window_new", Qt::CTRL+Qt::Key_D, this, SLOT( slotDuplicateWindow() ), actionCollection(), "duplicate_window" );
(void) new KAction( i18n( "Send &Link Address..." ), "mail_generic", 0, this, SLOT( slotSendURL() ), actionCollection(), "sendURL" );
(void) new KAction( i18n( "S&end File..." ), "mail_generic", 0, this, SLOT( slotSendFile() ), actionCollection(), "sendPage" );
if (kapp->authorize("shell_access"))
{
(void) new KAction( i18n( "Open &Terminal" ), "openterm", Key_F4, this, SLOT( slotOpenTerminal() ), actionCollection(), "open_terminal" );
(void) new KAction( i18n( "Open &Terminal" ), "openterm", Qt::Key_F4, this, SLOT( slotOpenTerminal() ), actionCollection(), "open_terminal" );
}
(void) new KAction( i18n( "&Open Location..." ), "fileopen", KStdAccel::shortcut(KStdAccel::Open), this, SLOT( slotOpenLocation() ), actionCollection(), "open_location" );
@ -3768,26 +3791,26 @@ void KonqMainWindow::initActions()
m_paConfigureSpellChecking = new KAction( i18n("Configure Spell Checking..."), "spellcheck", 0,this, SLOT( slotConfigureSpellChecking()), actionCollection(), "configurespellcheck");
// Window menu
m_paSplitViewHor = new KAction( i18n( "Split View &Left/Right" ), "view_left_right", CTRL+SHIFT+Key_L, this, SLOT( slotSplitViewHorizontal() ), actionCollection(), "splitviewh" );
m_paSplitViewVer = new KAction( i18n( "Split View &Top/Bottom" ), "view_top_bottom", CTRL+SHIFT+Key_T, this, SLOT( slotSplitViewVertical() ), actionCollection(), "splitviewv" );
m_paAddTab = new KAction( i18n( "&New Tab" ), "tab_new", "CTRL+SHIFT+N;CTRL+T", this, SLOT( slotAddTab() ), actionCollection(), "newtab" );
m_paDuplicateTab = new KAction( i18n( "&Duplicate Current Tab" ), "tab_duplicate", CTRL+SHIFT+Key_D, this, SLOT( slotDuplicateTab() ), actionCollection(), "duplicatecurrenttab" );
m_paBreakOffTab = new KAction( i18n( "Detach Current Tab" ), "tab_breakoff", CTRL+SHIFT+Key_B, this, SLOT( slotBreakOffTab() ), actionCollection(), "breakoffcurrenttab" );
m_paRemoveView = new KAction( i18n( "&Close Active View" ),"view_remove", CTRL+SHIFT+Key_R, this, SLOT( slotRemoveView() ), actionCollection(), "removeview" );
m_paRemoveTab = new KAction( i18n( "Close Current Tab" ), "tab_remove", CTRL+Key_W, this, SLOT( slotRemoveTab() ), actionCollection(), "removecurrenttab" );
m_paSplitViewHor = new KAction( i18n( "Split View &Left/Right" ), "view_left_right", Qt::CTRL+Qt::SHIFT+Qt::Key_L, this, SLOT( slotSplitViewHorizontal() ), actionCollection(), "splitviewh" );
m_paSplitViewVer = new KAction( i18n( "Split View &Top/Bottom" ), "view_top_bottom", Qt::CTRL+Qt::SHIFT+Qt::Key_T, this, SLOT( slotSplitViewVertical() ), actionCollection(), "splitviewv" );
m_paAddTab = new KAction( i18n( "&New Tab" ), "tab_new", "Qt::CTRL+Qt::SHIFT+N;Qt::CTRL+T", this, SLOT( slotAddTab() ), actionCollection(), "newtab" );
m_paDuplicateTab = new KAction( i18n( "&Duplicate Current Tab" ), "tab_duplicate", Qt::CTRL+Qt::SHIFT+Qt::Key_D, this, SLOT( slotDuplicateTab() ), actionCollection(), "duplicatecurrenttab" );
m_paBreakOffTab = new KAction( i18n( "Detach Current Tab" ), "tab_breakoff", Qt::CTRL+Qt::SHIFT+Qt::Key_B, this, SLOT( slotBreakOffTab() ), actionCollection(), "breakoffcurrenttab" );
m_paRemoveView = new KAction( i18n( "&Close Active View" ),"view_remove", Qt::CTRL+Qt::SHIFT+Qt::Key_R, this, SLOT( slotRemoveView() ), actionCollection(), "removeview" );
m_paRemoveTab = new KAction( i18n( "Close Current Tab" ), "tab_remove", Qt::CTRL+Qt::Key_W, this, SLOT( slotRemoveTab() ), actionCollection(), "removecurrenttab" );
m_paRemoveOtherTabs = new KAction( i18n( "Close &Other Tabs" ), "tab_remove", 0, this, SLOT( slotRemoveOtherTabsPopup() ), actionCollection(), "removeothertabs" );
m_paActivateNextTab = new KAction( i18n( "Activate Next Tab" ), "tab_next", QApplication::reverseLayout() ? KStdAccel::tabPrev() : KStdAccel::tabNext(), this, SLOT( slotActivateNextTab() ), actionCollection(), "activatenexttab" );
m_paActivatePrevTab = new KAction( i18n( "Activate Previous Tab" ), "tab_previous", QApplication::reverseLayout() ? KStdAccel::tabNext() : KStdAccel::tabPrev(), this, SLOT( slotActivatePrevTab() ), actionCollection(), "activateprevtab" );
QCString actionname;
Q3CString actionname;
for (int i=1;i<13;i++) {
actionname.sprintf("activate_tab_%02d", i);
new KAction(i18n("Activate Tab %1").arg(i), 0, this, SLOT(slotActivateTab()), actionCollection(), actionname);
}
m_paMoveTabLeft = new KAction( i18n("Move Tab Left"), 0 , CTRL+SHIFT+Key_Left,this, SLOT( slotMoveTabLeft()),actionCollection(),"tab_move_left");
m_paMoveTabRight = new KAction( i18n("Move Tab Right"), 0 , CTRL+SHIFT+Key_Right,this, SLOT( slotMoveTabRight()),actionCollection(),"tab_move_right");
m_paMoveTabLeft = new KAction( i18n("Move Tab Left"), 0 , Qt::CTRL+Qt::SHIFT+Qt::Key_Left,this, SLOT( slotMoveTabLeft()),actionCollection(),"tab_move_left");
m_paMoveTabRight = new KAction( i18n("Move Tab Right"), 0 , Qt::CTRL+Qt::SHIFT+Qt::Key_Right,this, SLOT( slotMoveTabRight()),actionCollection(),"tab_move_right");
#ifndef NDEBUG
(void) new KAction( i18n( "Dump Debug Info" ), "view_dump_debug_info", 0, this, SLOT( slotDumpDebugInfo() ), actionCollection(), "dumpdebuginfo" );
@ -3800,14 +3823,14 @@ void KonqMainWindow::initActions()
m_ptaFullScreen = KStdAction::fullScreen( 0, 0, actionCollection(), this );
KShortcut fullScreenShortcut = m_ptaFullScreen->shortcut();
fullScreenShortcut.append( KKey( Key_F11 ) );
fullScreenShortcut.append( KKey( Qt::Key_F11 ) );
m_ptaFullScreen->setShortcut( fullScreenShortcut );
connect( m_ptaFullScreen, SIGNAL( toggled( bool )), this, SLOT( slotUpdateFullScreen( bool )));
KShortcut reloadShortcut = KStdAccel::shortcut(KStdAccel::Reload);
reloadShortcut.append(KKey(CTRL + Key_R));
reloadShortcut.append(KKey(Qt::CTRL + Qt::Key_R));
m_paReload = new KAction( i18n( "&Reload" ), "reload", reloadShortcut, this, SLOT( slotReload() ), actionCollection(), "reload" );
m_paReloadAllTabs = new KAction( i18n( "&Reload All Tabs" ), "reload_all_tabs", SHIFT+Key_F5, this, SLOT( slotReloadAllTabs() ), actionCollection(), "reload_all_tabs" );
m_paReloadAllTabs = new KAction( i18n( "&Reload All Tabs" ), "reload_all_tabs", Qt::SHIFT+Qt::Key_F5, this, SLOT( slotReloadAllTabs() ), actionCollection(), "reload_all_tabs" );
m_paUndo = KStdAction::undo( KonqUndoManager::self(), SLOT( undo() ), actionCollection(), "undo" );
//m_paUndo->setEnabled( KonqUndoManager::self()->undoAvailable() );
@ -3817,25 +3840,25 @@ void KonqMainWindow::initActions()
// Those are connected to the browserextension directly
m_paCut = KStdAction::cut( 0, 0, actionCollection(), "cut" );
KShortcut cutShortCut = m_paCut->shortcut();
cutShortCut.remove( KKey( SHIFT + Key_Delete ) ); // used for deleting files
cutShortCut.remove( KKey( Qt::SHIFT + Qt::Key_Delete ) ); // used for deleting files
m_paCut->setShortcut( cutShortCut );
m_paCopy = KStdAction::copy( 0, 0, actionCollection(), "copy" );
m_paPaste = KStdAction::paste( 0, 0, actionCollection(), "paste" );
m_paStop = new KAction( i18n( "&Stop" ), "stop", Key_Escape, this, SLOT( slotStop() ), actionCollection(), "stop" );
m_paStop = new KAction( i18n( "&Stop" ), "stop", Qt::Key_Escape, this, SLOT( slotStop() ), actionCollection(), "stop" );
m_paRename = new KAction( i18n( "&Rename" ), /*"editrename",*/ Key_F2, actionCollection(), "rename" );
m_paTrash = new KAction( i18n( "&Move to Trash" ), "edittrash", Key_Delete, actionCollection(), "trash" );
m_paRename = new KAction( i18n( "&Rename" ), /*"editrename",*/ Qt::Key_F2, actionCollection(), "rename" );
m_paTrash = new KAction( i18n( "&Move to Trash" ), "edittrash", Qt::Key_Delete, actionCollection(), "trash" );
connect( m_paTrash, SIGNAL( activated( KAction::ActivationReason, Qt::ButtonState ) ),
this, SLOT( slotTrashActivated( KAction::ActivationReason, Qt::ButtonState ) ) );
m_paDelete = new KAction( i18n( "&Delete" ), "editdelete", SHIFT+Key_Delete, actionCollection(), "del" );
m_paDelete = new KAction( i18n( "&Delete" ), "editdelete", Qt::SHIFT+Qt::Key_Delete, actionCollection(), "del" );
m_paAnimatedLogo = new KonqLogoAction( i18n("Animated Logo"), 0, this, SLOT( slotDuplicateWindow() ), actionCollection(), "animated_logo" );
// Location bar
m_locationLabel = new KonqDraggableLabel( this, i18n("L&ocation: ") );
(void) new KWidgetAction( m_locationLabel, i18n("L&ocation: "), Key_F6, this, SLOT( slotLocationLabelActivated() ), actionCollection(), "location_label" );
(void) new KWidgetAction( m_locationLabel, i18n("L&ocation: "), Qt::Key_F6, this, SLOT( slotLocationLabelActivated() ), actionCollection(), "location_label" );
m_locationLabel->setBuddy( m_combo );
KWidgetAction* comboAction = new KWidgetAction( m_combo, i18n( "Location Bar" ), 0,
@ -3843,12 +3866,12 @@ void KonqMainWindow::initActions()
comboAction->setShortcutConfigurable( false );
comboAction->setAutoSized( true );
QWhatsThis::add( m_combo, i18n( "Location Bar<p>"
m_combo->setWhatsThis( i18n( "Location Bar<p>"
"Enter a web address or search term." ) );
KAction *clearLocation = new KAction( i18n( "Clear Location Bar" ),
QApplication::reverseLayout() ? "clear_left" : "locationbar_erase",
CTRL+Key_L, actionCollection(), "clear_location" );
Qt::CTRL+Qt::Key_L, actionCollection(), "clear_location" );
connect( clearLocation, SIGNAL( activated( KAction::ActivationReason, Qt::ButtonState ) ),
SLOT( slotClearLocationBar( KAction::ActivationReason, Qt::ButtonState ) ) );
clearLocation->setWhatsThis( i18n( "Clear Location bar<p>"
@ -3866,8 +3889,8 @@ void KonqMainWindow::initActions()
m_pBookmarkMenu = new KBookmarkMenu( KonqBookmarkManager::self(), m_pBookmarksOwner, m_pamBookmarks->popupMenu(), m_bookmarksActionCollection, true );
connect( m_pBookmarkMenu,
SIGNAL( aboutToShowContextMenu(const KBookmark &, QPopupMenu*) ),
this, SLOT( slotFillContextMenu(const KBookmark &, QPopupMenu*) ));
SIGNAL( aboutToShowContextMenu(const KBookmark &, Q3PopupMenu*) ),
this, SLOT( slotFillContextMenu(const KBookmark &, Q3PopupMenu*) ));
connect( m_pBookmarkMenu,
SIGNAL( openBookmark(const QString &, Qt::ButtonState) ),
this, SLOT( slotOpenBookmarkURL(const QString &, Qt::ButtonState) ));
@ -3952,7 +3975,7 @@ void KonqMainWindow::initActions()
m_paLinkView->setToolTip( i18n("Sets the view as 'linked'. A linked view follows folder changes made in other linked views.") );
}
void KonqMainWindow::slotFillContextMenu( const KBookmark &bk, QPopupMenu * pm )
void KonqMainWindow::slotFillContextMenu( const KBookmark &bk, Q3PopupMenu * pm )
{
kdDebug() << "KonqMainWindow::slotFillContextMenu(bk, pm == " << pm << ")" << endl;
popupItems.clear();
@ -3960,8 +3983,8 @@ void KonqMainWindow::slotFillContextMenu( const KBookmark &bk, QPopupMenu * pm )
if ( bk.isGroup() )
{
KBookmarkGroup grp = bk.toGroup();
QValueList<KURL> list = grp.groupUrlList();
QValueList<KURL>::Iterator it = list.begin();
Q3ValueList<KURL> list = grp.groupUrlList();
Q3ValueList<KURL>::Iterator it = list.begin();
for (; it != list.end(); ++it )
popupItems.append( new KFileItem( (*it), QString::null, KFileItem::Unknown) );
pm->insertItem( SmallIcon("tab_new"), i18n( "Open Folder in Tabs" ), this, SLOT( slotPopupNewTabRight() ) );
@ -4101,7 +4124,7 @@ void KonqMainWindow::updateViewActions()
m_paActivateNextTab->setEnabled( state );
m_paActivatePrevTab->setEnabled( state );
QPtrList<KonqFrameBase>* childFrameList = tabContainer->childFrameList();
Q3PtrList<KonqFrameBase>* childFrameList = tabContainer->childFrameList();
m_paMoveTabLeft->setEnabled( currentView() ? currentView()->frame()!=
(QApplication::reverseLayout() ? childFrameList->last() : childFrameList->first()) : false );
m_paMoveTabRight->setEnabled( currentView() ? currentView()->frame()!=
@ -4138,15 +4161,15 @@ void KonqMainWindow::updateViewActions()
{
// F5 is the default key binding for Reload.... a la Windows.
// mc users want F5 for Copy and F6 for move, but I can't make that default.
m_paCopyFiles = new KAction( i18n("Copy &Files..."), Key_F7, this, SLOT( slotCopyFiles() ), actionCollection(), "copyfiles" );
m_paMoveFiles = new KAction( i18n("M&ove Files..."), Key_F8, this, SLOT( slotMoveFiles() ), actionCollection(), "movefiles" );
m_paCopyFiles = new KAction( i18n("Copy &Files..."), Qt::Key_F7, this, SLOT( slotCopyFiles() ), actionCollection(), "copyfiles" );
m_paMoveFiles = new KAction( i18n("M&ove Files..."), Qt::Key_F8, this, SLOT( slotMoveFiles() ), actionCollection(), "movefiles" );
// This action doesn't appear in the GUI, it's for the shortcut only.
// KNewMenu takes care of the GUI stuff.
m_paNewDir = new KAction( i18n("Create Folder..." ), Key_F10, this, SLOT( slotNewDir() ),
m_paNewDir = new KAction( i18n("Create Folder..." ), Qt::Key_F10, this, SLOT( slotNewDir() ),
actionCollection(), "konq_create_dir" );
QPtrList<KAction> lst;
Q3PtrList<KAction> lst;
lst.append( m_paCopyFiles );
lst.append( m_paMoveFiles );
m_paCopyFiles->setEnabled( false );
@ -4175,15 +4198,15 @@ QString KonqMainWindow::findIndexFile( const QString &dir )
{
QDir d( dir );
QString f = d.filePath( "index.html", false );
QString f = d.filePath( QLatin1String ( "index.html" ) );
if ( QFile::exists( f ) )
return f;
f = d.filePath( "index.htm", false );
f = d.filePath( QLatin1String ( "index.htm" ) );
if ( QFile::exists( f ) )
return f;
f = d.filePath( "index.HTML", false );
f = d.filePath( QLatin1String( "index.HTML" ) );
if ( QFile::exists( f ) )
return f;
@ -4197,16 +4220,14 @@ void KonqMainWindow::connectExtension( KParts::BrowserExtension *ext )
KParts::BrowserExtension::ActionSlotMap::ConstIterator it = actionSlotMap->begin();
KParts::BrowserExtension::ActionSlotMap::ConstIterator itEnd = actionSlotMap->end();
QStrList slotNames = ext->metaObject()->slotNames();
for ( ; it != itEnd ; ++it )
{
KAction * act = actionCollection()->action( it.key() );
KAction * act = actionCollection()->action( it.key().data() );
//kdDebug(1202) << it.key() << endl;
if ( act )
{
// Does the extension have a slot with the name of this action ?
if ( slotNames.contains( it.key()+"()" ) )
if ( ext->metaObject()->indexOfSlot( it.key()+"()" ) != -1 )
{
if ( it.key() != "trash" )
connect( act, SIGNAL( activated() ), ext, it.data() /* SLOT(slot name) */ );
@ -4231,13 +4252,11 @@ void KonqMainWindow::disconnectExtension( KParts::BrowserExtension *ext )
KParts::BrowserExtension::ActionSlotMap::ConstIterator it = actionSlotMap->begin();
KParts::BrowserExtension::ActionSlotMap::ConstIterator itEnd = actionSlotMap->end();
QStrList slotNames = ext->metaObject()->slotNames();
for ( ; it != itEnd ; ++it )
{
KAction * act = actionCollection()->action( it.key() );
KAction * act = actionCollection()->action( it.key().data() );
//kdDebug(1202) << it.key() << endl;
if ( act && slotNames.contains( it.key()+"()" ) )
if ( act && ext->metaObject()->indexOfSlot( it.key()+"()" ) != -1 )
{
//kdDebug(1202) << "disconnectExtension: " << act << " " << act->name() << endl;
act->disconnect( ext );
@ -4306,9 +4325,9 @@ void KonqMainWindow::enableAllActions( bool enable )
kdDebug(1202) << "KonqMainWindow::enableAllActions " << enable << endl;
KParts::BrowserExtension::ActionSlotMap * actionSlotMap = KParts::BrowserExtension::actionSlotMapPtr();
QValueList<KAction *> actions = actionCollection()->actions();
QValueList<KAction *>::Iterator it = actions.begin();
QValueList<KAction *>::Iterator end = actions.end();
Q3ValueList<KAction *> actions = actionCollection()->actions();
Q3ValueList<KAction *>::Iterator it = actions.begin();
Q3ValueList<KAction *>::Iterator end = actions.end();
for (; it != end; ++it )
{
KAction *act = *it;
@ -4337,7 +4356,7 @@ void KonqMainWindow::enableAllActions( bool enable )
if (m_toggleViewGUIClient)
{
QPtrList<KAction> actions = m_toggleViewGUIClient->actions();
Q3PtrList<KAction> actions = m_toggleViewGUIClient->actions();
for ( KAction * it = actions.first(); it ; it = actions.next() )
it->setEnabled( true );
}
@ -4364,7 +4383,7 @@ void KonqMainWindow::disableActionsNoView()
m_paLinkView->setEnabled( false );
if (m_toggleViewGUIClient)
{
QPtrList<KAction> actions = m_toggleViewGUIClient->actions();
Q3PtrList<KAction> actions = m_toggleViewGUIClient->actions();
for ( KAction * it = actions.first(); it ; it = actions.next() )
it->setEnabled( false );
}
@ -4459,8 +4478,8 @@ void KonqExtendedBookmarkOwner::slotFillBookmarksList( KExtendedBookmarkOwner::Q
KonqFrameTabs* tabContainer = static_cast<KonqFrameTabs*>(docContainer);
QPtrList<KonqFrameBase> frameList = *tabContainer->childFrameList();
QPtrListIterator<KonqFrameBase> it( frameList );
Q3PtrList<KonqFrameBase> frameList = *tabContainer->childFrameList();
Q3PtrListIterator<KonqFrameBase> it( frameList );
for ( it.toFirst(); it != 0L; ++it )
{
@ -4656,7 +4675,7 @@ void KonqMainWindow::slotPopupMenu( KXMLGUIClient *client, const QPoint &_global
else
kpf |= KonqPopupMenu::IsLink; // HACK
QGuardedPtr<KonqPopupMenu> pPopupMenu = new KonqPopupMenu(
QPointer<KonqPopupMenu> pPopupMenu = new KonqPopupMenu(
KonqBookmarkManager::self(), _items,
viewURL,
popupMenuCollection,
@ -4733,7 +4752,7 @@ void KonqMainWindow::slotPopupMenu( KXMLGUIClient *client, const QPoint &_global
void KonqMainWindow::slotOpenEmbedded()
{
QCString name = sender()->name();
Q3CString name = sender()->name();
m_popupService = m_popupEmbeddingServices[ name.toInt() ]->desktopEntryName();
@ -4876,7 +4895,7 @@ void KonqMainWindow::updateViewModeActions()
unplugViewModeActions();
if ( m_viewModeMenu )
{
QPtrListIterator<KRadioAction> it( m_viewModeActions );
Q3PtrListIterator<KRadioAction> it( m_viewModeActions );
for (; it.current(); ++it )
it.current()->unplugAll();
delete m_viewModeMenu;
@ -4960,7 +4979,7 @@ void KonqMainWindow::updateViewModeActions()
// default service on this action: the current one (i.e. the first one)
QString text = itname;
QString icon = (*it)->icon();
QCString name = (*it)->desktopEntryName().latin1();
Q3CString name = (*it)->desktopEntryName().latin1();
//kdDebug(1202) << " Creating action for " << library << ". Default service " << itname << endl;
// if we previously changed the viewmode (see slotViewModeToggle!)
@ -5062,7 +5081,7 @@ void KonqMainWindow::saveToolBarServicesMap()
void KonqMainWindow::plugViewModeActions()
{
QPtrList<KAction> lst;
Q3PtrList<KAction> lst;
lst.append( m_viewModeMenu );
plugActionList( "viewmode", lst );
// display the toolbar viewmode icons only for inode/directory, as here we have dedicated icons
@ -5144,7 +5163,7 @@ void KonqMainWindow::closeEvent( QCloseEvent *e )
MapViews::ConstIterator end = m_mapViews.end();
for (; it != end; ++it ) {
KonqView *view = it.data();
if (view && view->part() && (view->part()->metaObject()->findProperty("modified") != -1) ) {
if (view && view->part() && (view->part()->metaObject()->indexOfProperty("modified") != -1) ) {
QVariant prop = view->part()->property("modified");
if (prop.isValid() && prop.toBool()) {
m_pViewManager->showTab( view );
@ -5162,7 +5181,7 @@ void KonqMainWindow::closeEvent( QCloseEvent *e )
// m_pViewManager->showTab( originalView );
}
else if ( m_currentView && m_currentView->part() &&
(m_currentView->part()->metaObject()->findProperty("modified") != -1) )
(m_currentView->part()->metaObject()->indexOfProperty("modified") != -1) )
{
QVariant prop = m_currentView->part()->property("modified");
if (prop.isValid() && prop.toBool())
@ -5226,7 +5245,7 @@ void KonqMainWindow::goURL()
if ( !lineEdit )
return;
QKeyEvent event( QEvent::KeyPress, Key_Return, '\n', 0 );
QKeyEvent event( QEvent::KeyPress, Qt::Key_Return, '\n', 0 );
QApplication::sendEvent( lineEdit, &event );
}
@ -5344,7 +5363,7 @@ static QString hp_tryPrepend( const QString& s )
{
if( s.isEmpty() || s[ 0 ] == '/' )
return QString::null;
for( unsigned int pos = 0;
for( int pos = 0;
pos < s.length() - 2; // 4 = ://x
++pos )
{
@ -5504,7 +5523,7 @@ QStringList KonqMainWindow::historyPopupCompletionItems( const QString& s)
hp_removeDuplicates( matches );
QStringList items = matches.list();
if( items.count() == 0
&& !s.contains( ':' ) && s[ 0 ] != '/' )
&& !s.contains( ':' ) && !s.isEmpty() && s[ 0 ] != '/' )
{
QString pre = hp_tryPrepend( s );
if( !pre.isNull())
@ -5568,7 +5587,7 @@ QWidget* KonqMainWindow::widget() { return this; }
void KonqMainWindow::listViews( ChildViewList *viewList ) { if( m_pChildFrame ) m_pChildFrame->listViews( viewList ); }
QCString KonqMainWindow::frameType() { return QCString("MainWindow"); }
Q3CString KonqMainWindow::frameType() { return Q3CString("MainWindow"); }
KonqFrameBase* KonqMainWindow::childFrame()const { return m_pChildFrame; }
@ -5624,31 +5643,32 @@ void KonqMainWindow::resetWindow()
char data[ 1 ];
// empty append to get current X timestamp
QWidget tmp_widget;
XChangeProperty( qt_xdisplay(), tmp_widget.winId(), XA_WM_CLASS, XA_STRING, 8,
XChangeProperty( QX11Info::display(), tmp_widget.winId(), XA_WM_CLASS, XA_STRING, 8,
PropModeAppend, (unsigned char*) &data, 0 );
XEvent ev;
XWindowEvent( qt_xdisplay(), tmp_widget.winId(), PropertyChangeMask, &ev );
XWindowEvent( QX11Info::display(), tmp_widget.winId(), PropertyChangeMask, &ev );
long x_time = ev.xproperty.time;
// bad hack - without updating the _KDE_NET_WM_USER_CREATION_TIME property,
// KWin will apply don't_steal_focus to this window, and will not make it active
// (shows mainly with 'konqueror --preload')
static Atom atom = XInternAtom( qt_xdisplay(), "_KDE_NET_WM_USER_CREATION_TIME", False );
XChangeProperty( qt_xdisplay(), winId(), atom, XA_CARDINAL, 32,
static Atom atom = XInternAtom( QX11Info::display(), "_KDE_NET_WM_USER_CREATION_TIME", False );
XChangeProperty( QX11Info::display(), winId(), atom, XA_CARDINAL, 32,
PropModeReplace, (unsigned char *) &x_time, 1);
extern Time qt_x_user_time; // reset also user time, so that this window
qt_x_user_time = CurrentTime; // won't have _NET_WM_USER_TIME set
// reset also user time, so that this window won't have _NET_WM_USER_TIME set
QX11Info::setAppUserTime(CurrentTime);
#if !KDE_IS_VERSION( 3, 2, 90 ) // _KDE_NET_USER_TIME is obsolete
static Atom atom2 = XInternAtom( qt_xdisplay(), "_KDE_NET_USER_TIME", False );
static Atom atom2 = XInternAtom( QX11Info::display(), "_KDE_NET_USER_TIME", False );
timeval tv;
gettimeofday( &tv, NULL );
unsigned long now = tv.tv_sec * 10 + tv.tv_usec / 100000;
XChangeProperty(qt_xdisplay(), winId(), atom2, XA_CARDINAL,
XChangeProperty(QX11Info::display(), winId(), atom2, XA_CARDINAL,
32, PropModeReplace, (unsigned char *)&now, 1);
#endif
static Atom atom3 = XInternAtom( qt_xdisplay(), "_NET_WM_USER_TIME", False );
XDeleteProperty( qt_xdisplay(), winId(), atom3 );
static Atom atom3 = XInternAtom( QX11Info::display(), "_NET_WM_USER_TIME", False );
XDeleteProperty( QX11Info::display(), winId(), atom3 );
// Qt remembers the iconic state if the window was withdrawn while on another virtual desktop
clearWState( WState_Minimized );
setWindowState( windowState() & ~Qt::WindowMinimized );
ignoreInitialGeometry();
kapp->setTopWidget( this ); // set again the default window icon
}
@ -5663,7 +5683,7 @@ bool KonqMainWindow::event( QEvent* e )
// so catch QEvent::DefferedDelete and check if this window should stay
if( stayPreloaded())
{
setWFlags(WDestructiveClose); // was reset before deleteLater()
setAttribute(Qt::WA_DeleteOnClose); // was reset before deleteLater()
return true; // no deleting
}
}
@ -5684,8 +5704,9 @@ bool KonqMainWindow::stayPreloaded()
if( !checkPreloadResourceUsage())
return false;
DCOPRef ref( "kded", "konqy_preloader" );
QX11Info info;
if( !ref.callExt( "registerPreloadedKonqy", DCOPRef::NoEventLoop, 5000,
kapp->dcopClient()->appId(), qt_xscreen()))
kapp->dcopClient()->appId(), info.screen()))
{
return false;
}
@ -5740,12 +5761,13 @@ static int current_memory_usage( int* limit )
{
#ifdef __linux__
// Check whole memory usage - VmSize
QFile f( QCString().sprintf( "/proc/%i/statm", getpid()));
if( f.open( IO_ReadOnly ))
QFile f( Q3CString().sprintf( "/proc/%i/statm", getpid()));
if( f.open( QIODevice::ReadOnly ))
{
QString line;
if( f.readLine( line, 1024 ) > 0 )
while (!f.atEnd())
{
line = f.readLine();
line = line.stripWhiteSpace();
int usage = line.section( ' ', 0, 0 ).toInt();
if( usage > 0 )

View file

@ -25,7 +25,15 @@
#include <qmap.h>
#include <qpoint.h>
#include <qtimer.h>
#include <qguardedptr.h>
#include <qpointer.h>
//Added by qt3to4:
#include <QPixmap>
#include <Q3CString>
#include <QCloseEvent>
#include <Q3PtrList>
#include <QEvent>
#include <QLabel>
#include <QCustomEvent>
#include <kfileitem.h>
#include "konq_openurlrequest.h"
@ -247,7 +255,7 @@ public:
bool saveViewPropertiesLocally() const { return m_bSaveViewPropertiesLocally; }
static QPtrList<KonqMainWindow> *mainWindowList() { return s_lstViews; }
static Q3PtrList<KonqMainWindow> *mainWindowList() { return s_lstViews; }
// public for konq_guiclients
void viewCountChanged();
@ -258,7 +266,7 @@ public:
// operates on all combos of all mainwindows of this instance
// up to now adds an entry or clears all entries
static void comboAction( int action, const QString& url,
const QCString& objId );
const Q3CString& objId );
#ifndef NDEBUG
void dumpViewList();
@ -293,7 +301,7 @@ public:
QWidget* widget();
void listViews( ChildViewList *viewList );
QCString frameType();
Q3CString frameType();
KonqFrameBase* childFrame()const;
@ -328,7 +336,7 @@ public slots:
void slotCtrlTabPressed();
// for KBookmarkMenu and KBookmarkBar
void slotFillContextMenu( const KBookmark &, QPopupMenu * );
void slotFillContextMenu( const KBookmark &, Q3PopupMenu * );
void slotOpenBookmarkURL( const QString & url, Qt::ButtonState state );
void slotPopupMenu( const QPoint &_global, const KURL &_url, const QString &_mimeType, mode_t mode );
@ -517,7 +525,7 @@ protected slots:
protected:
virtual bool eventFilter(QObject*obj,QEvent *ev);
void fillHistoryPopup( QPopupMenu *menu, const QPtrList<HistoryEntry> &history );
void fillHistoryPopup( Q3PopupMenu *menu, const Q3PtrList<HistoryEntry> &history );
bool makeViewsFollow( const KURL & url, const KParts::URLArgs &args, const QString & serviceType,
KonqView * senderView );
@ -682,7 +690,7 @@ private:
MapViews m_mapViews;
QGuardedPtr<KonqView> m_currentView;
QPointer<KonqView> m_currentView;
KBookmarkMenu* m_pBookmarkMenu;
KonqExtendedBookmarkOwner *m_pBookmarksOwner;
@ -714,7 +722,7 @@ private:
QStringList m_configureModules;
QLabel* m_locationLabel;
QGuardedPtr<KonqCombo> m_combo;
QPointer<KonqCombo> m_combo;
static KConfig *s_comboConfig;
KURLCompletion *m_pURLCompletion;
// just a reference to KonqHistoryManager's completionObject
@ -729,11 +737,11 @@ private:
QString m_initialFrameName;
QPtrList<KAction> m_openWithActions;
Q3PtrList<KAction> m_openWithActions;
KActionMenu *m_viewModeMenu;
QPtrList<KAction> m_toolBarViewModeActions; // basically holds two KonqViewActions, one of
Q3PtrList<KAction> m_toolBarViewModeActions; // basically holds two KonqViewActions, one of
// iconview and one for listview
QPtrList<KRadioAction> m_viewModeActions;
Q3PtrList<KRadioAction> m_viewModeActions;
QMap<QString,KService::Ptr> m_viewModeToolBarServices; // similar to m_toolBarViewModeActions
// it holds a map library name (libkonqiconview/libkonqlistview) ==> service (service for
// iconview, multicolumnview, treeview, etc .)
@ -742,7 +750,7 @@ private:
static QStringList *s_plstAnimatedLogo;
static QPtrList<KonqMainWindow> *s_lstViews;
static Q3PtrList<KonqMainWindow> *s_lstViews;
QString m_currentDir; // stores current dir for relative URLs whenever applicable

View file

@ -18,9 +18,15 @@
*/
#include <qwhatsthis.h>
#include <q3whatsthis.h>
#include <qstyle.h>
#include <qdir.h>
//Added by qt3to4:
#include <QMouseEvent>
#include <QDragEnterEvent>
#include <QLabel>
#include <QDropEvent>
#include <Q3PtrList>
#include <kapplication.h>
#include <kdebug.h>
@ -47,10 +53,10 @@
// Terminates fullscreen-mode for any full-screen window on the current desktop
void KonqMisc::abortFullScreenMode()
{
QPtrList<KonqMainWindow> *mainWindows = KonqMainWindow::mainWindowList();
Q3PtrList<KonqMainWindow> *mainWindows = KonqMainWindow::mainWindowList();
if ( mainWindows )
{
QPtrListIterator<KonqMainWindow> it( *mainWindows );
Q3PtrListIterator<KonqMainWindow> it( *mainWindows );
for (; it.current(); ++it )
{
if ( it.current()->fullScreenMode() )
@ -247,7 +253,7 @@ void KonqDraggableLabel::mouseMoveEvent( QMouseEvent * ev )
{
KURL::List lst;
lst.append( m_mw->currentView()->url() );
QDragObject * drag = new KURLDrag( lst, m_mw );
Q3DragObject * drag = new KURLDrag( lst, m_mw );
drag->setPixmap( KMimeType::pixmapForURL( lst.first(), 0, KIcon::Small ) );
drag->dragCopy();
}

View file

@ -25,6 +25,10 @@
#include <krun.h>
#include <kparts/browserextension.h>
//Added by qt3to4:
#include <QMouseEvent>
#include <QDragEnterEvent>
#include <QDropEvent>
class KonqMainWindow;
class KonqView;

View file

@ -23,9 +23,9 @@
#include <qcheckbox.h>
#include <qdir.h>
#include <qvbox.h>
#include <q3vbox.h>
#include <qlabel.h>
#include <qheader.h>
#include <q3header.h>
#include <qlineedit.h>
#include <klistview.h>
@ -64,7 +64,7 @@ KonqProfileMap KonqProfileDlg::readAllProfiles()
}
KonqProfileItem::KonqProfileItem( KListView *parent, const QString & text )
: QListViewItem( parent, text ), m_profileName( text )
: Q3ListViewItem( parent, text ), m_profileName( text )
{
}
@ -81,7 +81,7 @@ KonqProfileDlg::KonqProfileDlg( KonqViewManager *manager, const QString & presel
{
m_pViewManager = manager;
QVBox* box = new QVBox( this );
Q3VBox* box = new Q3VBox( this );
box->setSpacing( KDialog::spacingHint() );
setMainWidget( box );
@ -100,8 +100,8 @@ KonqProfileDlg::KonqProfileDlg( KonqViewManager *manager, const QString & presel
box->setStretchFactor( m_pListView, 1 );
connect( m_pListView, SIGNAL( itemRenamed( QListViewItem * ) ),
SLOT( slotItemRenamed( QListViewItem * ) ) );
connect( m_pListView, SIGNAL( itemRenamed( Q3ListViewItem * ) ),
SLOT( slotItemRenamed( Q3ListViewItem * ) ) );
loadAllProfiles( preselectProfile );
m_pListView->setMinimumSize( m_pListView->sizeHint() );
@ -112,8 +112,8 @@ KonqProfileDlg::KonqProfileDlg( KonqViewManager *manager, const QString & presel
m_cbSaveSize = new QCheckBox( i18n("Save &window size in profile"), box );
m_cbSaveSize->setChecked( KonqSettings::saveWindowSizeInProfile() );
connect( m_pListView, SIGNAL( selectionChanged( QListViewItem * ) ),
this, SLOT( slotSelectionChanged( QListViewItem * ) ) );
connect( m_pListView, SIGNAL( selectionChanged( Q3ListViewItem * ) ),
this, SLOT( slotSelectionChanged( Q3ListViewItem * ) ) );
connect( m_pProfileNameLineEdit, SIGNAL( textChanged( const QString & ) ),
this, SLOT( slotTextChanged( const QString & ) ) );
@ -140,7 +140,7 @@ void KonqProfileDlg::loadAllProfiles(const QString & preselectProfile)
KonqProfileMap::ConstIterator eEnd = m_mapEntries.end();
for (; eIt != eEnd; ++eIt )
{
QListViewItem *item = new KonqProfileItem( m_pListView, eIt.key() );
Q3ListViewItem *item = new KonqProfileItem( m_pListView, eIt.key() );
QString filename = eIt.data().mid( eIt.data().findRev( '/' ) + 1 );
kdDebug(1202) << filename << endl;
if ( filename == preselectProfile )
@ -191,13 +191,13 @@ void KonqProfileDlg::slotUser2() // Delete button
void KonqProfileDlg::slotUser1() // Rename button
{
QListViewItem *item = m_pListView->selectedItem();
Q3ListViewItem *item = m_pListView->selectedItem();
if ( item )
m_pListView->rename( item, 0 );
}
void KonqProfileDlg::slotItemRenamed( QListViewItem * item )
void KonqProfileDlg::slotItemRenamed( Q3ListViewItem * item )
{
KonqProfileItem * profileItem = static_cast<KonqProfileItem *>( item );
@ -224,7 +224,7 @@ void KonqProfileDlg::slotItemRenamed( QListViewItem * item )
}
}
void KonqProfileDlg::slotSelectionChanged( QListViewItem * item )
void KonqProfileDlg::slotSelectionChanged( Q3ListViewItem * item )
{
m_pProfileNameLineEdit->setText( item ? item->text(0) : QString::null );
}
@ -236,7 +236,7 @@ void KonqProfileDlg::slotTextChanged( const QString & text )
// If we type the name of a profile, select it in the list
bool itemSelected = false;
QListViewItem * item;
Q3ListViewItem * item;
for ( item = m_pListView->firstChild() ; item ; item = item->nextSibling() )
if ( item->text(0) == text /*only full text, not partial*/ )

View file

@ -22,11 +22,13 @@
#include <kdialogbase.h>
#include <qlistview.h>
#include <q3listview.h>
#include <qmap.h>
//Added by qt3to4:
#include <QGridLayout>
class KonqViewManager;
class QListViewItem;
class Q3ListViewItem;
class QGridLayout;
class QCheckBox;
class QLineEdit;
@ -35,7 +37,7 @@ class KListView;
typedef QMap<QString, QString> KonqProfileMap;
class KonqProfileItem : public QListViewItem
class KonqProfileItem : public Q3ListViewItem
{
public:
KonqProfileItem( KListView *, const QString & );
@ -62,9 +64,9 @@ protected slots:
virtual void slotUser2(); // User2 is "Delete Profile" button
virtual void slotUser3(); // User3 is Save button
void slotTextChanged( const QString & );
void slotSelectionChanged( QListViewItem * item );
void slotSelectionChanged( Q3ListViewItem * item );
void slotItemRenamed( QListViewItem * );
void slotItemRenamed( Q3ListViewItem * );
private:
void loadAllProfiles(const QString & = QString::null);

View file

@ -21,7 +21,7 @@
#define __kfm_run_h__
#include <kparts/browserrun.h>
#include <qguardedptr.h>
#include <qpointer.h>
#include <kservice.h>
#include "konq_openurlrequest.h"
@ -63,8 +63,8 @@ protected slots:
void slotRedirection( KIO::Job *, const KURL& );
protected:
QGuardedPtr<KonqMainWindow> m_pMainWindow;
QGuardedPtr<KonqView> m_pView;
QPointer<KonqMainWindow> m_pMainWindow;
QPointer<KonqView> m_pView;
bool m_bFoundMimeType;
KonqOpenURLRequest m_req;
KURL m_mailto;

View file

@ -23,10 +23,13 @@
#include <qapplication.h>
#include <qclipboard.h>
#include <qptrlist.h>
#include <qpopupmenu.h>
#include <q3ptrlist.h>
#include <q3popupmenu.h>
#include <qtoolbutton.h>
#include <qtooltip.h>
//Added by qt3to4:
#include <QDragMoveEvent>
#include <QDropEvent>
#include <kdebug.h>
#include <kiconloader.h>
@ -44,7 +47,7 @@
#include <konq_pixmapprovider.h>
#include <kstdaccel.h>
#include <qtabbar.h>
#include <qwhatsthis.h>
#include <q3whatsthis.h>
#include <qstyle.h>
#define DUPLICATE_ID 3
@ -62,7 +65,7 @@ KonqFrameTabs::KonqFrameTabs(QWidget* parent, KonqFrameContainerBase* parentCont
{
KAcceleratorManager::setNoAccel(this);
QWhatsThis::add( tabBar(), i18n( "This bar contains list of currently open tabs. Click on a tab to make it "
tabBar()->setWhatsThis(i18n( "This bar contains list of currently open tabs. Click on a tab to make it "
"active. The option to show a close button instead of website icon in the left "
"corner of the tab is configurable. You can also use keyboard shortcuts to "
"navigate through tabs. The text on the tab is the title of the website "
@ -71,7 +74,7 @@ KonqFrameTabs::KonqFrameTabs(QWidget* parent, KonqFrameContainerBase* parentCont
//kdDebug(1202) << "KonqFrameTabs::KonqFrameTabs()" << endl;
m_pParentContainer = parentContainer;
m_pChildFrameList = new QPtrList<KonqFrameBase>;
m_pChildFrameList = new Q3PtrList<KonqFrameBase>;
m_pChildFrameList->setAutoDelete(false);
m_pActiveChild = 0L;
m_pViewManager = viewManager;
@ -79,7 +82,7 @@ KonqFrameTabs::KonqFrameTabs(QWidget* parent, KonqFrameContainerBase* parentCont
connect( this, SIGNAL( currentChanged ( QWidget * ) ),
this, SLOT( slotCurrentChanged( QWidget* ) ) );
m_pPopupMenu = new QPopupMenu( this );
m_pPopupMenu = new Q3PopupMenu( this );
m_pPopupMenu->insertItem( SmallIcon( "tab_new" ),
i18n("&New Tab"),
m_pViewManager->mainWindow(),
@ -97,7 +100,7 @@ KonqFrameTabs::KonqFrameTabs(QWidget* parent, KonqFrameContainerBase* parentCont
SLOT( slotReloadPopup() ),
m_pViewManager->mainWindow()->action("reload")->shortcut(), RELOAD_ID );
m_pPopupMenu->insertSeparator();
m_pSubPopupMenuTab = new QPopupMenu( this );
m_pSubPopupMenuTab = new Q3PopupMenu( this );
m_pPopupMenu->insertItem( i18n("Other Tabs" ), m_pSubPopupMenuTab, OTHERTABS_ID );
connect( m_pSubPopupMenuTab, SIGNAL( activated ( int ) ),
this, SLOT( slotSubPopupMenuTabActivated( int ) ) );
@ -143,7 +146,7 @@ KonqFrameTabs::KonqFrameTabs(QWidget* parent, KonqFrameContainerBase* parentCont
m_leftWidget->setIconSet( SmallIcon( "tab_new" ) );
m_leftWidget->adjustSize();
QToolTip::add(m_leftWidget, i18n("Open a new tab"));
setCornerWidget( m_leftWidget, TopLeft );
setCornerWidget( m_leftWidget, Qt::TopLeftCorner );
}
if ( KonqSettings::closeTabButton() ) {
m_rightWidget = new QToolButton( this );
@ -152,7 +155,7 @@ KonqFrameTabs::KonqFrameTabs(QWidget* parent, KonqFrameContainerBase* parentCont
m_rightWidget->setIconSet( SmallIconSet( "tab_remove" ) );
m_rightWidget->adjustSize();
QToolTip::add(m_rightWidget, i18n("Close the current tab"));
setCornerWidget( m_rightWidget, TopRight );
setCornerWidget( m_rightWidget, Qt::TopRightCorner );
}
setAutomaticResizeTabs( true );
@ -184,7 +187,7 @@ KonqFrameTabs::~KonqFrameTabs()
}
void KonqFrameTabs::listViews( ChildViewList *viewList ) {
for( QPtrListIterator<KonqFrameBase> it( *m_pChildFrameList ); *it; ++it )
for( Q3PtrListIterator<KonqFrameBase> it( *m_pChildFrameList ); *it; ++it )
it.current()->listViews(viewList);
}
@ -199,7 +202,7 @@ void KonqFrameTabs::saveConfig( KConfig* config, const QString &prefix, bool sav
{
newPrefix = QString::fromLatin1( it->frameType() ) + "T" + QString::number(i);
strlst.append( newPrefix );
newPrefix.append( '_' );
newPrefix.append( QLatin1Char( '_' ) );
it->saveConfig( config, newPrefix, saveURLs, docContainer, id, depth + i );
i++;
}
@ -257,7 +260,7 @@ void KonqFrameTabs::setTitle( const QString &title , QWidget* sender)
void KonqFrameTabs::setTabIcon( const QString &url, QWidget* sender )
{
//kdDebug(1202) << "KonqFrameTabs::setTabIcon( " << url << " , " << sender << " )" << endl;
QIconSet iconSet;
QIcon iconSet;
if (m_permanentCloseButtons)
iconSet = SmallIcon( "fileclose" );
else
@ -322,7 +325,7 @@ void KonqFrameTabs::removeChildFrame( KonqFrameBase * frame )
void KonqFrameTabs::slotCurrentChanged( QWidget* newPage )
{
setTabColor( newPage, KGlobalSettings::textColor() );
// setTabColor( newPage, KGlobalSettings::textColor() ); ###
KonqFrameBase* currentFrame = dynamic_cast<KonqFrameBase*>(newPage);
if (currentFrame && !m_pViewManager->isLoadingProfile()) {
@ -411,7 +414,7 @@ void KonqFrameTabs::refreshSubPopupMenuTab()
if ( title.isEmpty() )
title = frame->activeChildView()->url().url();
title = KStringHandler::csqueeze( title, 50 );
m_pSubPopupMenuTab->insertItem( QIconSet( KonqPixmapProvider::self()->pixmapFor( frame->activeChildView()->url().url() ) ), title, i );
m_pSubPopupMenuTab->insertItem( QIcon( KonqPixmapProvider::self()->pixmapFor( frame->activeChildView()->url().url() ) ), title, i );
}
i++;
@ -441,8 +444,7 @@ void KonqFrameTabs::slotSubPopupMenuTabActivated( int _id)
void KonqFrameTabs::slotMouseMiddleClick()
{
QApplication::clipboard()->setSelectionMode( QClipboard::Selection );
KURL filteredURL ( KonqMisc::konqFilteredURL( this, QApplication::clipboard()->text() ) );
KURL filteredURL ( KonqMisc::konqFilteredURL( this, QApplication::clipboard()->text(QClipboard::Selection) ) );
if ( !filteredURL.isEmpty() ) {
KonqView* newView = m_pViewManager->addTab(QString::null, QString::null, false, false);
if (newView == 0L) return;
@ -462,8 +464,7 @@ void KonqFrameTabs::slotMouseMiddleClick( QWidget *w )
}
}
else {
QApplication::clipboard()->setSelectionMode( QClipboard::Selection );
KURL filteredURL ( KonqMisc::konqFilteredURL( this, QApplication::clipboard()->text() ) );
KURL filteredURL ( KonqMisc::konqFilteredURL( this, QApplication::clipboard()->text(QClipboard::Selection ) ) );
if ( !filteredURL.isEmpty() ) {
KonqFrameBase* frame = dynamic_cast<KonqFrameBase*>(w);
if (frame) {

View file

@ -25,9 +25,15 @@
#include "konq_frame.h"
#include <ktabwidget.h>
//Added by qt3to4:
#include <QPixmap>
#include <QDragMoveEvent>
#include <Q3CString>
#include <QDropEvent>
#include <Q3PtrList>
class QPixmap;
class QPopupMenu;
class Q3PopupMenu;
class QToolButton;
class KonqView;
@ -59,13 +65,13 @@ public:
virtual void printFrameInfo( const QString& spaces );
QPtrList<KonqFrameBase>* childFrameList() { return m_pChildFrameList; }
Q3PtrList<KonqFrameBase>* childFrameList() { return m_pChildFrameList; }
virtual void setTitle( const QString &title, QWidget* sender );
virtual void setTabIcon( const QString &url, QWidget* sender );
virtual QWidget* widget() { return this; }
virtual QCString frameType() { return QCString("Tabs"); }
virtual Q3CString frameType() { return Q3CString("Tabs"); }
void activateChild();
@ -99,7 +105,7 @@ protected:
void refreshSubPopupMenuTab();
void hideTabBar();
QPtrList<KonqFrameBase>* m_pChildFrameList;
Q3PtrList<KonqFrameBase>* m_pChildFrameList;
private slots:
void slotContextMenu( const QPoint& );
@ -117,8 +123,8 @@ private slots:
private:
KonqViewManager* m_pViewManager;
QPopupMenu* m_pPopupMenu;
QPopupMenu* m_pSubPopupMenuTab;
Q3PopupMenu* m_pPopupMenu;
Q3PopupMenu* m_pSubPopupMenuTab;
QToolButton* m_rightWidget;
QToolButton* m_leftWidget;
bool m_permanentCloseButtons;

View file

@ -39,13 +39,20 @@
#include <kdebug.h>
#include <kcursor.h>
#include <kurldrag.h>
#include <qscrollview.h>
#include <q3scrollview.h>
#include <qapplication.h>
#include <qmetaobject.h>
#include <qobjectlist.h>
#include <qobject.h>
//Added by qt3to4:
#include <Q3CString>
#include <Q3PtrList>
#include <QEvent>
#include <QDropEvent>
#include <QContextMenuEvent>
#include <QDragEnterEvent>
#include <QMouseEvent>
#include <config.h>
#include <private/qucomextra_p.h>
#include <kmessagebox.h>
#include <klocale.h>
@ -53,7 +60,7 @@
//#define DEBUG_HISTORY
template class QPtrList<HistoryEntry>;
template class Q3PtrList<HistoryEntry>;
KonqView::KonqView( KonqViewFactory &viewFactory,
KonqFrame* viewFrame,
@ -116,7 +123,7 @@ KonqView::~KonqView()
part_url = m_pPart->url().url();
if (part_url.isNull())
part_url = "";
QCString line;
Q3CString line;
line = ( QString("close(%1):%2\n").arg(m_randID,0,16).arg(part_url) ).utf8();
KonqMainWindow::s_crashlog_file->writeBlock(line, line.length());
KonqMainWindow::s_crashlog_file->flush();
@ -153,7 +160,7 @@ void KonqView::openURL( const KURL &url, const QString & locationBarURL,
if (url_url.isNull())
url_url = QString("");
QCString line;
Q3CString line;
line = ( QString("closed(%1):%2\n").arg(m_randID,0,16).arg(part_url) ).utf8();
KonqMainWindow::s_crashlog_file->writeBlock(line,line.length());
@ -475,7 +482,7 @@ void KonqView::connectPart( )
if (m_bBackRightClick && m_pPart->widget()->inherits("QScrollView") )
{
(static_cast<QScrollView *>(m_pPart->widget()))->viewport()->installEventFilter( this );
(static_cast<Q3ScrollView *>(m_pPart->widget()))->viewport()->installEventFilter( this );
}
// KonqDirPart signal
@ -740,7 +747,7 @@ void KonqView::updateHistoryEntry( bool saveLocationBarURL )
if ( browserExtension() )
{
current->buffer = QByteArray(); // Start with empty buffer.
QDataStream stream( current->buffer, IO_WriteOnly );
QDataStream stream( &current->buffer, QIODevice::WriteOnly );
browserExtension()->saveState( stream );
}
@ -844,7 +851,7 @@ void KonqView::restoreHistory()
if ( browserExtension() )
{
//kdDebug(1202) << "Restoring view from stream" << endl;
QDataStream stream( h.buffer, IO_ReadOnly );
QDataStream stream( h.buffer );
browserExtension()->restoreState( stream );
@ -880,7 +887,7 @@ void KonqView::copyHistory( KonqView *other )
{
m_lstHistory.clear();
QPtrListIterator<HistoryEntry> it( other->m_lstHistory );
Q3PtrListIterator<HistoryEntry> it( other->m_lstHistory );
for (; it.current(); ++it )
m_lstHistory.append( new HistoryEntry( *it.current() ) );
m_lstHistory.at(other->m_lstHistory.at());
@ -1038,8 +1045,8 @@ QStringList KonqView::childFrameNames( KParts::ReadOnlyPart *part )
res += hostExtension->frameNames();
const QPtrList<KParts::ReadOnlyPart> children = hostExtension->frames();
QPtrListIterator<KParts::ReadOnlyPart> it( children );
const Q3PtrList<KParts::ReadOnlyPart> children = hostExtension->frames();
Q3PtrListIterator<KParts::ReadOnlyPart> it( children );
for (; it.current(); ++it )
res += childFrameNames( it.current() );
@ -1056,8 +1063,8 @@ KParts::BrowserHostExtension* KonqView::hostExtension( KParts::ReadOnlyPart *par
if ( ext->frameNames().contains( name ) )
return ext;
const QPtrList<KParts::ReadOnlyPart> children = ext->frames();
QPtrListIterator<KParts::ReadOnlyPart> it( children );
const Q3PtrList<KParts::ReadOnlyPart> children = ext->frames();
Q3PtrListIterator<KParts::ReadOnlyPart> it( children );
for (; it.current(); ++it )
{
KParts::BrowserHostExtension *childHost = hostExtension( it.current(), name );
@ -1074,12 +1081,11 @@ bool KonqView::callExtensionMethod( const char *methodName )
if ( !obj ) // not all views have a browser extension !
return false;
int id = obj->metaObject()->findSlot( methodName );
int id = obj->metaObject()->indexOfSlot( methodName );
if ( id == -1 )
return false;
QUObject o[ 1 ];
QMetaObject::invokeMethod( obj, methodName, Qt::DirectConnection);
obj->qt_invoke( id, o );
return true;
}
@ -1089,14 +1095,12 @@ bool KonqView::callExtensionBoolMethod( const char *methodName, bool value )
if ( !obj ) // not all views have a browser extension !
return false;
int id = obj->metaObject()->findSlot( methodName );
int id = obj->metaObject()->indexOfSlot( methodName );
if ( id == -1 )
return false;
QUObject o[ 2 ];
static_QUType_bool.set( o + 1, value );
QMetaObject::invokeMethod( obj, methodName, Qt::DirectConnection, Q_ARG(bool,value));
obj->qt_invoke( id, o );
return true;
}
@ -1106,14 +1110,12 @@ bool KonqView::callExtensionStringMethod( const char *methodName, QString value
if ( !obj ) // not all views have a browser extension !
return false;
int id = obj->metaObject()->findSlot( methodName );
int id = obj->metaObject()->indexOfSlot( methodName );
if ( id == -1 )
return false;
QUObject o[ 2 ];
static_QUType_QString.set( o + 1, value );
QMetaObject::invokeMethod( obj, methodName, Qt::DirectConnection, Q_ARG(QString, value));
obj->qt_invoke( id, o );
return true;
}
@ -1123,14 +1125,12 @@ bool KonqView::callExtensionURLMethod( const char *methodName, const KURL& value
if ( !obj ) // not all views have a browser extension !
return false;
int id = obj->metaObject()->findSlot( methodName );
int id = obj->metaObject()->indexOfSlot( methodName );
if ( id == -1 )
return false;
QUObject o[ 2 ];
static_QUType_ptr.set( o + 1, &value );
QMetaObject::invokeMethod( obj, methodName, Qt::DirectConnection, Q_ARG(KURL, value));
obj->qt_invoke( id, o );
return true;
}
@ -1219,7 +1219,7 @@ void KonqView::reparseConfiguration()
{
if (m_bBackRightClick && m_pPart->widget()->inherits("QScrollView") )
{
(static_cast<QScrollView *>(m_pPart->widget()))->viewport()->installEventFilter( this );
(static_cast<Q3ScrollView *>(m_pPart->widget()))->viewport()->installEventFilter( this );
}
enableBackRightClick( b );
}
@ -1252,16 +1252,13 @@ bool KonqView::eventFilter( QObject *obj, QEvent *e )
KURL::List lstDragURLs;
bool ok = KURLDrag::decode( ev, lstDragURLs );
QObjectList *children = m_pPart->widget()->queryList( "QWidget" );
QObjectList children = m_pPart->widget()->queryList( "QWidget" );
if ( ok &&
!lstDragURLs.first().url().contains( "javascript:", false ) && // ### this looks like a hack to me
ev->source() != m_pPart->widget() &&
children &&
children->findRef( ev->source() ) == -1 )
children.indexOf( ev->source() ) == -1 )
ev->acceptAction();
delete children;
}
}
else if ( e->type() == QEvent::Drop && m_bURLDropHandling && obj == m_pPart->widget() )
@ -1289,7 +1286,7 @@ bool KonqView::eventFilter( QObject *obj, QEvent *e )
else if ( e->type() == QEvent::MouseButtonPress )
{
QMouseEvent *ev = static_cast<QMouseEvent *>( e );
if ( ev->button() == RightButton )
if ( ev->button() == Qt::RightButton )
{
return true;
}
@ -1297,7 +1294,7 @@ bool KonqView::eventFilter( QObject *obj, QEvent *e )
else if ( e->type() == QEvent::MouseButtonRelease )
{
QMouseEvent *ev = static_cast<QMouseEvent *>( e );
if ( ev->button() == RightButton )
if ( ev->button() == Qt::RightButton )
{
emit backRightClick();
return true;
@ -1306,7 +1303,7 @@ bool KonqView::eventFilter( QObject *obj, QEvent *e )
else if ( e->type() == QEvent::MouseMove )
{
QMouseEvent *ev = static_cast<QMouseEvent *>( e );
if ( ev->state() == RightButton )
if ( ev->button() == Qt::RightButton )
{
obj->removeEventFilter( this );
QMouseEvent me( QEvent::MouseButtonPress, ev->pos(), 2, 2 );

View file

@ -23,12 +23,14 @@
#include "konq_mainwindow.h"
#include "konq_factory.h"
#include <qptrlist.h>
#include <q3ptrlist.h>
#include <qstring.h>
#include <qobject.h>
#include <qstringlist.h>
#include <qguardedptr.h>
#include <qcstring.h>
#include <qpointer.h>
#include <q3cstring.h>
//Added by qt3to4:
#include <QEvent>
#include <ktrader.h>
@ -154,7 +156,7 @@ public:
/**
* @return the history of this view
*/
const QPtrList<HistoryEntry> & history() { return m_lstHistory; }
const Q3PtrList<HistoryEntry> & history() { return m_lstHistory; }
/**
* @return the HistoryEntry at postion @p pos
@ -428,7 +430,7 @@ private:
* The full history (back + current + forward)
* The current position in the history is m_lstHistory.current()
*/
QPtrList<HistoryEntry> m_lstHistory;
Q3PtrList<HistoryEntry> m_lstHistory;
/**
* The post data that _resulted_ in this page.

View file

@ -27,7 +27,10 @@
#include "konq_settingsxt.h"
#include <qfileinfo.h>
#include <qptrlist.h>
#include <q3ptrlist.h>
//Added by qt3to4:
#include <Q3StrList>
#include <Q3ValueList>
#include <kaccelgen.h>
#include <kstandarddirs.h>
@ -44,7 +47,7 @@
// #define DEBUG_VIEWMGR
template class QPtrList<KonqView>;
template class Q3PtrList<KonqView>;
KonqViewManager::KonqViewManager( KonqMainWindow *mainWindow )
: KParts::PartManager( mainWindow )
@ -116,7 +119,7 @@ KonqView* KonqViewManager::splitView ( Qt::Orientation orientation,
KonqFrameContainerBase* parentContainer = splitFrame->parentContainer();
bool moveNewContainer = false;
QValueList<int> splitterSizes;
Q3ValueList<int> splitterSizes;
int index= -1;
if (parentContainer->frameType()=="Container") {
@ -168,7 +171,7 @@ KonqView* KonqViewManager::splitView ( Qt::Orientation orientation,
newContainer->swapChildren();
}
QValueList<int> newSplitterSizes;
Q3ValueList<int> newSplitterSizes;
newSplitterSizes << 50 << 50;
newContainer->setSizes( newSplitterSizes );
@ -271,7 +274,7 @@ void KonqViewManager::convertDocContainer()
KonqFrameContainerBase* parentContainer = m_pDocContainer->parentContainer();
bool moveNewContainer = false;
QValueList<int> splitterSizes;
Q3ValueList<int> splitterSizes;
if (parentContainer->frameType()=="Container") {
moveNewContainer = (static_cast<KonqFrameContainer*>(parentContainer)->idAfter( m_pDocContainer->widget() ) != 0);
splitterSizes = static_cast<KonqFrameContainer*>(parentContainer)->sizes();
@ -423,7 +426,7 @@ void KonqViewManager::duplicateTab( KonqFrameBase* tab, bool openAfterCurrentPag
QString prefix = QString::fromLatin1( currentFrame->frameType() ) + QString::number(0);
config.writeEntry( "RootItem", prefix );
prefix.append( '_' );
prefix.append( QLatin1Char( '_' ) );
currentFrame->saveConfig( &config, prefix, true, 0L, 0, 1);
QString rootItem = config.readEntry( "RootItem", "empty" );
@ -493,7 +496,7 @@ void KonqViewManager::breakOffTab( KonqFrameBase* tab )
QString prefix = QString::fromLatin1( currentFrame->frameType() ) + QString::number(0);
config.writeEntry( "RootItem", prefix );
prefix.append( '_' );
prefix.append( QLatin1Char( '_' ) );
config.writeEntry( QString::fromLatin1( "docContainer" ).prepend( prefix ), true );
currentFrame->saveConfig( &config, prefix, true, 0L, 0, 1);
@ -565,8 +568,8 @@ void KonqViewManager::removeTab( KonqFrameBase* tab )
tabContainer->removeChildFrame(currentFrame);
QPtrList<KonqView> viewList;
QPtrListIterator<KonqView> it( viewList );
Q3PtrList<KonqView> viewList;
Q3PtrListIterator<KonqView> it( viewList );
currentFrame->listViews( &viewList );
@ -596,8 +599,8 @@ void KonqViewManager::reloadAllTabs( )
KonqFrameTabs* tabContainer = static_cast<KonqFrameTabs*>(m_pDocContainer);
QPtrList<KonqFrameBase> frameList = *tabContainer->childFrameList();
QPtrListIterator<KonqFrameBase> it( frameList );
Q3PtrList<KonqFrameBase> frameList = *tabContainer->childFrameList();
Q3PtrListIterator<KonqFrameBase> it( frameList );
for ( it.toFirst(); it != 0L; ++it )
{
@ -628,8 +631,8 @@ void KonqViewManager::removeOtherTabs( KonqFrameBase* tab )
return;
}
QPtrList<KonqFrameBase> frameList = *tabContainer->childFrameList();
QPtrListIterator<KonqFrameBase> it( frameList );
Q3PtrList<KonqFrameBase> frameList = *tabContainer->childFrameList();
Q3PtrListIterator<KonqFrameBase> it( frameList );
for ( it.toFirst(); it != 0L; ++it )
{
@ -726,8 +729,8 @@ void KonqViewManager::updatePixmaps()
KonqFrameTabs* tabContainer = static_cast<KonqFrameTabs*>(m_pDocContainer);
QPtrList<KonqView> viewList;
QPtrListIterator<KonqView> it( viewList );
Q3PtrList<KonqView> viewList;
Q3PtrListIterator<KonqView> it( viewList );
tabContainer->listViews( &viewList );
for ( it.toFirst(); it != 0L; ++it )
@ -760,7 +763,7 @@ void KonqViewManager::removeView( KonqView *view )
setActivePart( 0L, true );
int index = -1;
QValueList<int> splitterSizes;
Q3ValueList<int> splitterSizes;
bool moveOtherChild = false;
if (grandParentContainer->frameType()=="Tabs")
@ -916,13 +919,13 @@ void KonqViewManager::clear()
if (m_pMainWindow->childFrame() == 0L) return;
QPtrList<KonqView> viewList;
Q3PtrList<KonqView> viewList;
m_pMainWindow->listViews( &viewList );
kdDebug(1202) << viewList.count() << " items" << endl;
QPtrListIterator<KonqView> it( viewList );
Q3PtrListIterator<KonqView> it( viewList );
for ( it.toFirst(); it.current(); ++it ) {
m_pMainWindow->removeChildView( it.current() );
kdDebug(1202) << "Deleting " << it.current() << endl;
@ -1097,7 +1100,7 @@ void KonqViewManager::saveViewProfile( KConfig & cfg, bool saveURLs, bool saveWi
QString prefix = QString::fromLatin1( m_pMainWindow->childFrame()->frameType() )
+ QString::number(0);
cfg.writeEntry( "RootItem", prefix );
prefix.append( '_' );
prefix.append( QLatin1Char( '_' ) );
m_pMainWindow->saveConfig( &cfg, prefix, saveURLs, m_pDocContainer, 0, 1);
}
@ -1149,12 +1152,12 @@ void KonqViewManager::loadViewProfile( KConfig &cfg, const QString & filename,
}
KonqView *originalView = m_pMainWindow->currentView();
QPtrList<KonqFrameBase> frameList = *tabContainer->childFrameList();
QPtrListIterator<KonqFrameBase> it( frameList );
Q3PtrList<KonqFrameBase> frameList = *tabContainer->childFrameList();
Q3PtrListIterator<KonqFrameBase> it( frameList );
for ( it.toFirst(); it != 0L; ++it )
{
KonqView *view = it.current()->activeChildView();
if (view && view->part() && (view->part()->metaObject()->findProperty("modified") != -1)) {
if (view && view->part() && (view->part()->metaObject()->indexOfProperty("modified") != -1)) {
QVariant prop = view->part()->property("modified");
if (prop.isValid() && prop.toBool()) {
showTab( view );
@ -1173,7 +1176,7 @@ void KonqViewManager::loadViewProfile( KConfig &cfg, const QString & filename,
else
{
KonqView *view = m_pMainWindow->currentView();
if (view && view->part() && (view->part()->metaObject()->findProperty("modified") != -1)) {
if (view && view->part() && (view->part()->metaObject()->indexOfProperty("modified") != -1)) {
QVariant prop = view->part()->property("modified");
if (prop.isValid() && prop.toBool())
if ( KMessageBox::warningContinueCancel( 0,
@ -1445,7 +1448,7 @@ void KonqViewManager::loadItem( KConfig &cfg, KonqFrameContainerBase *parent,
{
QString prefix;
if( name != "InitialView" )
prefix = name + '_';
prefix = name + QLatin1Char( '_' );
//kdDebug(1202) << "begin loadItem: " << name << endl;
@ -1575,12 +1578,12 @@ void KonqViewManager::loadItem( KConfig &cfg, KonqFrameContainerBase *parent,
o = Qt::Horizontal;
}
QValueList<int> sizes =
Q3ValueList<int> sizes =
cfg.readIntListEntry( QString::fromLatin1( "SplitterSizes" ).prepend( prefix ));
int index = cfg.readNumEntry( QString::fromLatin1( "activeChildIndex" ).prepend(prefix), -1 );
QStrList childList;
Q3StrList childList;
if( cfg.readListEntry( QString::fromLatin1( "Children" ).prepend( prefix ), childList ) < 2 )
{
kdWarning() << "Profile Loading Error: Less than two children in " << name << endl;
@ -1717,7 +1720,7 @@ void KonqViewManager::slotProfileListAboutToShow()
if ( !m_pamProfiles || !m_bProfileListDirty )
return;
QPopupMenu *popup = m_pamProfiles->popupMenu();
Q3PopupMenu *popup = m_pamProfiles->popupMenu();
popup->clear();
// Fetch profiles
@ -1728,7 +1731,7 @@ void KonqViewManager::slotProfileListAboutToShow()
KAccelGen::generateFromKeys(m_mapProfileNames, accel_strings);
// Store menu items
QValueListIterator<QString> iter = accel_strings.begin();
QList<QString>::iterator iter = accel_strings.begin();
for( int id = 0;
iter != accel_strings.end();
++iter, ++id ) {
@ -1755,7 +1758,7 @@ void KonqViewManager::setLoading( KonqView *view, bool loading )
else
color = KGlobalSettings::textColor();
}
konqframetabs->setTabColor( view->frame(), color );
//konqframetabs->setTabColor( view->frame(), color ); ### FIXME, KDE4, no call
}
}
@ -1766,8 +1769,8 @@ void KonqViewManager::showHTML(bool b)
KonqFrameTabs* tabContainer = static_cast<KonqFrameTabs*>(m_pDocContainer);
QPtrList<KonqFrameBase> frameList = *tabContainer->childFrameList();
QPtrListIterator<KonqFrameBase> it( frameList );
Q3PtrList<KonqFrameBase> frameList = *tabContainer->childFrameList();
Q3PtrListIterator<KonqFrameBase> it( frameList );
for ( it.toFirst(); it != 0L; ++it )
{
@ -1798,10 +1801,10 @@ void KonqViewManager::printSizeInfo( KonqFrameBase* frame,
if ( parent->frameType() == "Container" )
{
QValueList<int> sizes;
Q3ValueList<int> sizes;
sizes = static_cast<KonqFrameContainer*>(parent)->sizes();
printf( "Parent sizes %s :", msg );
QValueList<int>::ConstIterator it;
Q3ValueList<int>::ConstIterator it;
for( it = sizes.begin(); it != sizes.end(); ++it )
printf( " %d", (*it) );
printf("\n");

View file

@ -25,7 +25,7 @@
#include <qnamespace.h>
#include <qobject.h>
#include <qmap.h>
#include <qguardedptr.h>
#include <qpointer.h>
#include <ktrader.h>
@ -351,7 +351,7 @@ private:
KonqFrameBase *m_pDocContainer;
QGuardedPtr<KActionMenu> m_pamProfiles;
QPointer<KActionMenu> m_pamProfiles;
bool m_bProfileListDirty;
bool m_bLoadingProfile;
QString m_currentProfile;

View file

@ -23,6 +23,8 @@
#include <kgenericfactory.h>
#include <kiconloader.h>
#include <qmessagebox.h>
//Added by qt3to4:
#include <Q3CString>
#include <klocale.h>
#include <qstring.h>
#include <qtimer.h>
@ -73,12 +75,12 @@ void KHTMLPluginKTTSD::slotReadOut()
// Find out if KTTSD supports xhtml (rich speak).
QByteArray data;
QBuffer dataBuf(data);
QBuffer dataBuf(&data);
QDataStream arg;
dataBuf.open(IO_WriteOnly);
arg.setDevice(&dataBuf);
arg << "" << KSpeech::mtHtml;
QCString replyType;
DCOPCString replyType;
QByteArray replyData;
bool supportsXhtml = false;
if ( !client->call("kttsd", "KSpeech", "supportsMarkup(QString,uint)",
@ -87,7 +89,9 @@ void KHTMLPluginKTTSD::slotReadOut()
i18n( "The DCOP call supportsMarkup failed." ));
else
{
QDataStream reply(replyData, IO_ReadOnly);
QDataStream reply(&replyData, IO_ReadOnly);
reply.setVersion(QDataStream::Qt_3_1);
reply >> supportsXhtml;
}

View file

@ -25,7 +25,7 @@
#include <assert.h>
#include <stdio.h>
#include <qpainter.h>
#include <qheader.h>
#include <q3header.h>
#include <kiconloader.h>
#include "konq_infolistviewitem.h"
#include "konq_infolistviewwidget.h"
@ -137,7 +137,7 @@ void KonqInfoListViewItem::gotMetaInfo()
}
}
int KonqInfoListViewItem::compare( QListViewItem *item, int col, bool ascending ) const
int KonqInfoListViewItem::compare( Q3ListViewItem *item, int col, bool ascending ) const
{
if ( col == 0 )
return KonqBaseListViewItem::compare( item, 0, ascending );
@ -229,8 +229,7 @@ void KonqInfoListViewItem::paintCell( QPainter *_painter, const QColorGroup & _c
cg.setBrush( QColorGroup::Base, QBrush( backgroundColor(_column), *pm ) );
QPoint o = _painter->brushOrigin();
_painter->setBrushOrigin( o.x() - lv->contentsX(), o.y() - lv->contentsY() );
const QColorGroup::ColorRole crole =
QPalette::backgroundRoleFromMode( lv->viewport()->backgroundMode() );
const QPalette::ColorRole crole = lv->viewport()->backgroundRole();
_painter->fillRect( newWidth, 0, _width - newWidth, height(), cg.brush( crole ) );
_painter->setBrushOrigin( o );
}
@ -248,11 +247,11 @@ void KonqInfoListViewItem::paintCell( QPainter *_painter, const QColorGroup & _c
void KonqInfoListViewItem::paintFocus( QPainter * _painter, const QColorGroup & cg, const QRect & _r )
{
QRect r( _r );
QListView *lv = static_cast< QListView * >( listView() );
Q3ListView *lv = static_cast< Q3ListView * >( listView() );
r.setWidth( width( lv->fontMetrics(), lv, 0 ) );
if ( r.right() > lv->header()->sectionRect( 0 ).right() )
r.setRight( lv->header()->sectionRect( 0 ).right() );
QListViewItem::paintFocus( _painter, cg, r );
Q3ListViewItem::paintFocus( _painter, cg, r );
}
#if 0

View file

@ -63,7 +63,7 @@ class KonqInfoListViewItem : public KonqBaseListViewItem
virtual void gotMetaInfo();
virtual int compare(QListViewItem *item, int col, bool ascending) const;
virtual int compare(Q3ListViewItem *item, int col, bool ascending) const;
protected:
/**
@ -72,8 +72,8 @@ class KonqInfoListViewItem : public KonqBaseListViewItem
KonqInfoListViewWidget* m_ILVWidget;
private:
QValueVector<QVariant::Type> m_columnTypes;
QValueVector<QVariant> m_columnValues;
Q3ValueVector<QVariant::Type> m_columnTypes;
Q3ValueVector<QVariant> m_columnValues;
};
#endif

View file

@ -55,7 +55,7 @@ void KonqInfoListViewWidget::slotSelectMimeType()
QString comment = m_mtSelector->currentText();
// find the mime type by comment
QMapIterator<QString, KonqILVMimeType> it;
QMap<QString, KonqILVMimeType>::iterator it;
for (it = m_counts.begin(); it!=m_counts.end(); ++it)
{
if ((*it).mimetype->comment() == comment)
@ -147,7 +147,7 @@ void KonqInfoListViewWidget::rebuildView()
// make a KFileItemList from all our Items
KFileItemList list;
QListViewItemIterator it(this);
Q3ListViewItemIterator it(this);
for (; it.current(); ++it)
{
list.append(static_cast<KonqInfoListViewItem*>(it.current())->item());
@ -157,7 +157,7 @@ void KonqInfoListViewWidget::rebuildView()
clear();
// and rebuild them
for (QPtrListIterator<KFileItem> kit(list); kit.current(); ++kit)
for (Q3PtrListIterator<KFileItem> kit(list); kit.current(); ++kit)
{
KonqInfoListViewItem* tmp = new KonqInfoListViewItem( this, *kit );
// if (m_goToFirstItem==false)
@ -190,7 +190,7 @@ void KonqInfoListViewWidget::rebuildView()
void KonqInfoListViewWidget::slotNewItems( const KFileItemList& list)
{
slotStarted(); // ############# WHY?
for (QPtrListIterator<KFileItem> kit ( list ); kit.current(); ++kit )
for (Q3PtrListIterator<KFileItem> kit ( list ); kit.current(); ++kit )
{
KonqInfoListViewItem * tmp = new KonqInfoListViewItem( this, *kit );
@ -230,7 +230,7 @@ void KonqInfoListViewWidget::slotNewItems( const KFileItemList& list)
// start getting metainfo from the files
if (m_metaInfoJob)
{
for (QPtrListIterator<KFileItem> kit ( list ); kit.current(); ++kit )
for (Q3PtrListIterator<KFileItem> kit ( list ); kit.current(); ++kit )
m_metaInfoTodo.append(kit.current());
}
else
@ -250,7 +250,7 @@ void KonqInfoListViewWidget::slotRefreshItems( const KFileItemList& list)
// start getting metainfo from the files
if (m_metaInfoJob)
{
for (QPtrListIterator<KFileItem> kit ( list ); kit.current(); ++kit )
for (Q3PtrListIterator<KFileItem> kit ( list ); kit.current(); ++kit )
m_metaInfoTodo.append(kit.current());
}
else
@ -286,7 +286,7 @@ void KonqInfoListViewWidget::slotClear()
void KonqInfoListViewWidget::slotMetaInfo(const KFileItem* item)
{
// need to search for the item (any better way?)
QListViewItemIterator it(this);
Q3ListViewItemIterator it(this);
for (; it.current(); ++it)
{
if (static_cast<KonqInfoListViewItem*>(it.current())->item()==item)
@ -340,7 +340,7 @@ void KonqInfoListViewWidget::determineCounts(const KFileItemList& list)
QStringList mtlist;
QMapIterator<QString, KonqILVMimeType> it;
QMap<QString, KonqILVMimeType>::iterator it;
for (it = m_counts.begin(); it!=m_counts.end(); ++it)
{
// look if there is a plugin for this mimetype

View file

@ -38,7 +38,7 @@
#include <qapplication.h>
#include <qclipboard.h>
#include <qheader.h>
#include <q3header.h>
#include <qregexp.h>
#include <assert.h>
@ -159,7 +159,7 @@ void ListViewBrowserExtension::pasteTo( const KURL& url )
void ListViewBrowserExtension::rename()
{
QListViewItem* item = m_listView->listViewWidget()->currentItem();
Q3ListViewItem* item = m_listView->listViewWidget()->currentItem();
Q_ASSERT ( item );
m_listView->listViewWidget()->rename( item, 0 );
@ -589,7 +589,7 @@ void KonqListView::slotSaveAfterHeaderDrag()
void KonqListView::slotSaveColumnWidths()
{
QValueList<int> lstColumnWidths;
Q3ValueList<int> lstColumnWidths;
for ( int i=0; i < m_pListView->columns(); i++ )
{
@ -665,11 +665,11 @@ void KonqListView::setupActions()
m_paShowPermissions->setCheckedState(i18n("Hide Permissions"));
m_paShowURL=new KToggleAction(i18n("Show URL"), 0, this, SLOT(slotColumnToggled()),actionCollection(), "show_url" );
m_paSelect = new KAction( i18n( "Se&lect..." ), CTRL+Key_Plus, this, SLOT( slotSelect() ), actionCollection(), "select" );
m_paUnselect = new KAction( i18n( "Unselect..." ), CTRL+Key_Minus, this, SLOT( slotUnselect() ), actionCollection(), "unselect" );
m_paSelect = new KAction( i18n( "Se&lect..." ), Qt::Key_Control+Qt::Key_Plus, this, SLOT( slotSelect() ), actionCollection(), "select" );
m_paUnselect = new KAction( i18n( "Unselect..." ), Qt::Key_Control+Qt::Key_Minus, this, SLOT( slotUnselect() ), actionCollection(), "unselect" );
m_paSelectAll = KStdAction::selectAll( this, SLOT( slotSelectAll() ), actionCollection(), "selectall" );
m_paUnselectAll = new KAction( i18n( "Unselect All" ), CTRL+Key_U, this, SLOT( slotUnselectAll() ), actionCollection(), "unselectall" );
m_paInvertSelection = new KAction( i18n( "&Invert Selection" ), CTRL+Key_Asterisk, this, SLOT( slotInvertSelection() ), actionCollection(), "invertselection" );
m_paUnselectAll = new KAction( i18n( "Unselect All" ), Qt::Key_Control+Qt::Key_U, this, SLOT( slotUnselectAll() ), actionCollection(), "unselectall" );
m_paInvertSelection = new KAction( i18n( "&Invert Selection" ), Qt::Key_Control+Qt::Key_Asterisk, this, SLOT( slotInvertSelection() ), actionCollection(), "invertselection" );
m_paShowDot = new KToggleAction( i18n( "Show &Hidden Files" ), 0, this, SLOT( slotShowDot() ), actionCollection(), "show_dot" );
// m_paShowDot->setCheckedState(i18n("Hide &Hidden Files"));

View file

@ -27,7 +27,7 @@
#include <konq_dirpart.h>
#include <kmimetyperesolver.h>
#include <qvaluelist.h>
#include <q3valuelist.h>
#include <qlistview.h>
#include <qstringlist.h>
@ -86,7 +86,7 @@ public:
//int iconSize() { return m_pListView->iconSize(); }
void determineIcon( KonqBaseListViewItem * item );
QPtrList<KonqBaseListViewItem> & lstPendingMimeIconItems() { return m_mimeTypeResolver->m_lstPendingMimeIconItems; }
Q3PtrList<KonqBaseListViewItem> & lstPendingMimeIconItems() { return m_mimeTypeResolver->m_lstPendingMimeIconItems; }
void listingComplete();
virtual void newIconSize( int );

View file

@ -24,7 +24,7 @@
#include <assert.h>
#include <stdio.h>
#include <qpainter.h>
#include <qheader.h>
#include <q3header.h>
#include <kiconloader.h>
static QString retrieveExtraEntry( KFileItem* fileitem, int numExtra )
@ -70,7 +70,7 @@ KonqListViewItem::KonqListViewItem( KonqBaseListViewWidget *_listViewWidget, KFi
KonqListViewItem::~KonqListViewItem()
{
for ( QValueVector<QPixmap*>::iterator
for ( Q3ValueVector<QPixmap*>::iterator
it = m_pixmaps.begin(), itEnd = m_pixmaps.end();
it != itEnd; ++it )
delete *it;
@ -218,7 +218,7 @@ void KonqListViewItem::setPixmap( int column, const QPixmap& pm )
// If we're just replacing the icon with another one its size -- i.e. a
// "highlighted" icon, don't bother repainting the whole widget.
QListView *lv = m_pListViewWidget;
Q3ListView *lv = m_pListViewWidget;
int decorationWidth = lv->treeStepSize() * ( depth() + ( lv->rootIsDecorated() ? 1 : 0 ) );
int x = lv->header()->sectionPos( column ) + decorationWidth + lv->itemMargin();
@ -240,7 +240,7 @@ const QPixmap* KonqListViewItem::pixmap( int column ) const
return pm;
}
int KonqBaseListViewItem::compare( QListViewItem* item, int col, bool ascending ) const
int KonqBaseListViewItem::compare( Q3ListViewItem* item, int col, bool ascending ) const
{
KonqListViewItem* k = static_cast<KonqListViewItem*>( item );
if ( sortChar != k->sortChar )
@ -317,8 +317,7 @@ void KonqListViewItem::paintCell( QPainter *_painter, const QColorGroup & _cg, i
cg.setBrush( QColorGroup::Base, QBrush( backgroundColor(_column), *pm ) );
QPoint o = _painter->brushOrigin();
_painter->setBrushOrigin( o.x() - lv->contentsX(), o.y() - lv->contentsY() );
const QColorGroup::ColorRole crole =
QPalette::backgroundRoleFromMode( lv->viewport()->backgroundMode() );
const QPalette::ColorRole crole = lv->viewport()->backgroundRole();
_painter->fillRect( newWidth, 0, _width - newWidth, height(), cg.brush( crole ) );
_painter->setBrushOrigin( o );
}
@ -336,11 +335,11 @@ void KonqListViewItem::paintCell( QPainter *_painter, const QColorGroup & _cg, i
void KonqListViewItem::paintFocus( QPainter * _painter, const QColorGroup & cg, const QRect & _r )
{
QRect r( _r );
QListView *lv = static_cast< QListView * >( listView() );
Q3ListView *lv = static_cast< Q3ListView * >( listView() );
r.setWidth( width( lv->fontMetrics(), lv, 0 ) );
if ( r.right() > lv->header()->sectionRect( 0 ).right() )
r.setRight( lv->header()->sectionRect( 0 ).right() );
QListViewItem::paintFocus( _painter, cg, r );
Q3ListViewItem::paintFocus( _painter, cg, r );
}
const char* KonqBaseListViewItem::makeAccessString( const mode_t mode)

View file

@ -24,7 +24,7 @@
#include <qstring.h>
#include <kicontheme.h>
#include <qvaluevector.h>
#include <q3valuevector.h>
// for mode_t
#include <sys/types.h>
@ -52,7 +52,7 @@ class KonqBaseListViewItem : public KListViewItem
virtual void updateContents() = 0;
virtual void setDisabled( bool disabled ) { m_bDisabled = disabled; }
virtual void setActive ( bool active ) { m_bActive = active; }
virtual int compare( QListViewItem* i, int col, bool ascending ) const;
virtual int compare( Q3ListViewItem* i, int col, bool ascending ) const;
int state() const
{
@ -114,7 +114,7 @@ class KonqListViewItem : public KonqBaseListViewItem
virtual const QPixmap * pixmap( int column ) const;
private:
QValueVector<QPixmap *> m_pixmaps;
Q3ValueVector<QPixmap *> m_pixmaps;
};
#endif

View file

@ -34,7 +34,7 @@
#include <kmessagebox.h>
#include <kiconloader.h>
#include <qheader.h>
#include <q3header.h>
#include <qpainter.h>
#include <qstyle.h>
#include <qtimer.h>
@ -118,22 +118,22 @@ KonqBaseListViewWidget::KonqBaseListViewWidget( KonqListView *parent, QWidget *p
initConfig();
#if 0
connect( this, SIGNAL(rightButtonPressed(QListViewItem*,const QPoint&,int)),
this, SLOT(slotRightButtonPressed(QListViewItem*,const QPoint&,int)));
connect( this, SIGNAL(rightButtonPressed(Q3ListViewItem*,const QPoint&,int)),
this, SLOT(slotRightButtonPressed(Q3ListViewItem*,const QPoint&,int)));
#endif
connect( this, SIGNAL(returnPressed( QListViewItem * )),
this, SLOT(slotReturnPressed( QListViewItem * )) );
connect( this, SIGNAL( mouseButtonClicked( int, QListViewItem *, const QPoint&, int )),
this, SLOT( slotMouseButtonClicked( int, QListViewItem *, const QPoint&, int )) );
connect( this, SIGNAL(executed( QListViewItem * )),
this, SLOT(slotExecuted( QListViewItem * )) );
connect( this, SIGNAL(returnPressed( Q3ListViewItem * )),
this, SLOT(slotReturnPressed( Q3ListViewItem * )) );
connect( this, SIGNAL( mouseButtonClicked( int, Q3ListViewItem *, const QPoint&, int )),
this, SLOT( slotMouseButtonClicked( int, Q3ListViewItem *, const QPoint&, int )) );
connect( this, SIGNAL(executed( Q3ListViewItem * )),
this, SLOT(slotExecuted( Q3ListViewItem * )) );
connect( this, SIGNAL(currentChanged( QListViewItem * )),
this, SLOT(slotCurrentChanged( QListViewItem * )) );
connect( this, SIGNAL(itemRenamed( QListViewItem *, const QString &, int )),
this, SLOT(slotItemRenamed( QListViewItem *, const QString &, int )) );
connect( this, SIGNAL(contextMenuRequested( QListViewItem *, const QPoint&, int )),
this, SLOT(slotPopupMenu( QListViewItem *, const QPoint&, int )) );
connect( this, SIGNAL(currentChanged( Q3ListViewItem * )),
this, SLOT(slotCurrentChanged( Q3ListViewItem * )) );
connect( this, SIGNAL(itemRenamed( Q3ListViewItem *, const QString &, int )),
this, SLOT(slotItemRenamed( Q3ListViewItem *, const QString &, int )) );
connect( this, SIGNAL(contextMenuRequested( Q3ListViewItem *, const QPoint&, int )),
this, SLOT(slotPopupMenu( Q3ListViewItem *, const QPoint&, int )) );
connect( this, SIGNAL(selectionChanged()), this, SLOT(slotSelectionChanged()) );
connect( horizontalScrollBar(), SIGNAL(valueChanged( int )),
@ -168,8 +168,8 @@ KonqBaseListViewWidget::KonqBaseListViewWidget( KonqListView *parent, QWidget *p
connect( header(), SIGNAL(sizeChange( int, int, int )), SLOT(slotUpdateBackground()) );
viewport()->setMouseTracking( true );
viewport()->setFocusPolicy( QWidget::WheelFocus );
setFocusPolicy( QWidget::WheelFocus );
viewport()->setFocusPolicy( Qt::WheelFocus );
setFocusPolicy( Qt::WheelFocus );
setAcceptDrops( true );
//looks better with the statusbar
@ -201,7 +201,7 @@ void KonqBaseListViewWidget::readProtocolConfig( const KURL & url )
m_filenameColumnWidth = config.fileNameColumnWidth();
QStringList lstColumns = config.columns();
QValueList<int> lstColumnWidths = config.columnWidths();
Q3ValueList<int> lstColumnWidths = config.columnWidths();
if (lstColumns.isEmpty())
{
// Default column selection
@ -253,12 +253,12 @@ void KonqBaseListViewWidget::readProtocolConfig( const KURL & url )
}
int currentColumn = m_filenameColumn + 1;
//check all columns in lstColumns
for ( unsigned int i = 0; i < lstColumns.count(); i++ )
for ( int i = 0; i < lstColumns.count(); i++ )
{
//search the column in confColumns
for ( unsigned int j = 0; j < NumberOfAtoms; j++ )
{
if ( confColumns[j].name == *lstColumns.at(i) )
if ( confColumns[j].name == lstColumns.at(i) )
{
confColumns[j].displayThisOne = true;
confColumns[j].displayInColumn = currentColumn;
@ -364,7 +364,7 @@ void KonqBaseListViewWidget::createColumns()
if ( sortedByColumn == confColumns[i].desktopFileName )
setSorting( currentColumn, m_bAscending );
if ( confColumns[i].udsId == KIO::UDS_SIZE )
setColumnAlignment( currentColumn, AlignRight );
setColumnAlignment( currentColumn, Qt::AlignRight );
i = -1;
currentColumn++;
}
@ -395,7 +395,7 @@ void KonqBaseListViewWidget::initConfig()
setItemFont( itemFont );
setItemColor( m_pSettings->normalTextColor() );
bool on = m_pSettings->showFileTips() && QToolTip::isGloballyEnabled();
bool on = m_pSettings->showFileTips();
m_fileTip->setOptions( on, m_pSettings->showPreviewsInFileTips(), m_pSettings->numFileTips() );
updateListContents();
@ -411,7 +411,7 @@ void KonqBaseListViewWidget::contentsMousePressEvent( QMouseEvent *e )
}
delete m_selected;
m_selected = new QPtrList<KonqBaseListViewItem>;
m_selected = new Q3PtrList<KonqBaseListViewItem>;
QPoint vp = contentsToViewport( e->pos() );
KonqBaseListViewItem* item = isExecuteArea( vp ) ?
@ -420,15 +420,15 @@ void KonqBaseListViewWidget::contentsMousePressEvent( QMouseEvent *e )
if ( item )
KListView::contentsMousePressEvent( e );
else {
if ( e->button() == LeftButton )
if ( e->button() == Qt::LeftButton )
{
if ( !( e->state() & ControlButton ) )
if ( !( e->modifiers() & Qt::ControlModifier ) )
setSelected( itemAt( vp ), false );
m_rubber = new QRect( e->x(), e->y(), 0, 0 );
m_fileTip->setItem( 0 );
}
if ( e->button() != RightButton )
QListView::contentsMousePressEvent( e );
if ( e->button() != Qt::RightButton )
Q3ListView::contentsMousePressEvent( e );
}
// Store list of selected items at mouse-press time.
// This is used when autoscrolling (why?)
@ -541,15 +541,21 @@ void KonqBaseListViewWidget::drawRubber()
QPainter p;
p.begin( viewport() );
p.setRasterOp( NotROP );
p.setPen( QPen( color0, 1 ) );
p.setBrush( NoBrush );
#warning FIXME NotROP is not available in qt4
//Using black with .5 alpha for now
//p.setRasterOp( NotROP );
QColor c( 0, 0, 0, 127 );
p.setPen( QPen( c, 1 ) );
p.setBrush( QBrush() );
QPoint pt( m_rubber->x(), m_rubber->y() );
pt = contentsToViewport( pt );
style().drawPrimitive( QStyle::PE_FocusRect, &p,
QRect( pt.x(), pt.y(), m_rubber->width(), m_rubber->height() ),
colorGroup(), QStyle::Style_Default, colorGroup().base() );
#warning PE_FocusRect is gone, using PE_FrameFocusRect
QStyleOptionFocusRect fr;
fr.backgroundColor = c;
fr.rect = QRect( pt.x(), pt.y(), m_rubber->width(), m_rubber->height() );
fr.palette = palette();
style()->drawPrimitive( QStyle::PE_FrameFocusRect, &fr, &p, viewport() );
p.end();
}
@ -572,7 +578,7 @@ void KonqBaseListViewWidget::slotAutoScroll()
drawRubber();
m_rubber->setBottomRight( vc );
QListViewItem *cur = itemAt( QPoint(0,0) );
Q3ListViewItem *cur = itemAt( QPoint(0,0) );
bool block = signalsBlocked();
blockSignals( true );
@ -599,7 +605,7 @@ void KonqBaseListViewWidget::slotAutoScroll()
}
QRect r = rect;
QListViewItem *tmp = cur;
Q3ListViewItem *tmp = cur;
while ( cur && rect.top() <= oldBottom )
{
@ -755,7 +761,7 @@ void KonqBaseListViewWidget::startDrag()
m_fileTip->setItem( 0 );
KURL::List urls = selectedUrls( false );
QListViewItem * m_pressedItem = currentItem();
Q3ListViewItem * m_pressedItem = currentItem();
QPixmap pixmap2;
bool pixmap0Invalid = !m_pressedItem->pixmap(0) || m_pressedItem->pixmap(0)->isNull();
@ -780,7 +786,7 @@ void KonqBaseListViewWidget::startDrag()
drag->drag();
}
void KonqBaseListViewWidget::slotItemRenamed( QListViewItem *item, const QString &name, int col )
void KonqBaseListViewWidget::slotItemRenamed( Q3ListViewItem *item, const QString &name, int col )
{
Q_ASSERT( col == 0 );
Q_ASSERT( item != 0 );
@ -823,9 +829,9 @@ void KonqBaseListViewWidget::slotSelectionChanged()
}
void KonqBaseListViewWidget::slotMouseButtonClicked( int _button,
QListViewItem *_item, const QPoint& pos, int )
Q3ListViewItem *_item, const QPoint& pos, int )
{
if ( _button == MidButton )
if ( _button == Qt::MidButton )
{
if ( _item && isExecuteArea( viewport()->mapFromGlobal(pos) ) )
m_pBrowserView->mmbClicked( static_cast<KonqBaseListViewItem *>(_item)->item() );
@ -834,7 +840,7 @@ void KonqBaseListViewWidget::slotMouseButtonClicked( int _button,
}
}
void KonqBaseListViewWidget::slotExecuted( QListViewItem *item )
void KonqBaseListViewWidget::slotExecuted( Q3ListViewItem *item )
{
if ( !item )
return;
@ -846,7 +852,7 @@ void KonqBaseListViewWidget::slotExecuted( QListViewItem *item )
slotReturnPressed( item );
}
void KonqBaseListViewWidget::selectedItems( QPtrList<KonqBaseListViewItem> *_list )
void KonqBaseListViewWidget::selectedItems( Q3PtrList<KonqBaseListViewItem> *_list )
{
iterator it = begin();
for ( ; it != end(); it++ )
@ -892,7 +898,7 @@ KonqPropsView * KonqBaseListViewWidget::props() const
return m_pBrowserView->m_pProps;
}
void KonqBaseListViewWidget::slotReturnPressed( QListViewItem *_item )
void KonqBaseListViewWidget::slotReturnPressed( Q3ListViewItem *_item )
{
if ( !_item )
return;
@ -909,7 +915,7 @@ void KonqBaseListViewWidget::slotReturnPressed( QListViewItem *_item )
KMessageBox::information( 0, i18n("You must take the file out of the trash before being able to use it.") );
}
void KonqBaseListViewWidget::slotPopupMenu( QListViewItem *i, const QPoint &point, int c )
void KonqBaseListViewWidget::slotPopupMenu( Q3ListViewItem *i, const QPoint &point, int c )
{
kdDebug(1202) << "KonqBaseListViewWidget::slotPopupMenu" << endl;
popupMenu( point, ( i != 0 && c == -1 ) ); // i != 0 && c == -1 when activated by keyboard
@ -927,7 +933,7 @@ void KonqBaseListViewWidget::popupMenu( const QPoint& _global, bool alwaysForSel
// a popup for the current dir instead.
if ( alwaysForSelectedFiles || isExecuteArea( viewport()->mapFromGlobal( _global ) ) )
{
QPtrList<KonqBaseListViewItem> items;
Q3PtrList<KonqBaseListViewItem> items;
selectedItems( &items );
for ( KonqBaseListViewItem *item = items.first(); item; item = items.next() )
lstItems.append( item->item() );
@ -1136,7 +1142,7 @@ void KonqBaseListViewWidget::slotNewItems( const KFileItemList & entries )
{
//kdDebug(1202) << k_funcinfo << entries.count() << endl;
for ( QPtrListIterator<KFileItem> kit ( entries ); kit.current(); ++kit )
for ( Q3PtrListIterator<KFileItem> kit ( entries ); kit.current(); ++kit )
{
KonqListViewItem * tmp = new KonqListViewItem( this, *kit );
if ( !m_itemFound && tmp->text(0) == m_itemToGoTo )
@ -1182,7 +1188,7 @@ void KonqBaseListViewWidget::slotDeleteItem( KFileItem * _fileitem )
}
delete &(*it);
// HACK HACK HACK: QListViewItem/KonqBaseListViewItem should
// HACK HACK HACK: Q3ListViewItem/KonqBaseListViewItem should
// take care and the source looks like it does; till the
// real bug is found, this fixes some crashes (malte)
emit selectionChanged();
@ -1206,7 +1212,7 @@ void KonqBaseListViewWidget::slotRefreshItems( const KFileItemList & entries )
{
//kdDebug(1202) << k_funcinfo << endl;
QPtrListIterator<KFileItem> kit ( entries );
Q3PtrListIterator<KFileItem> kit ( entries );
for ( ; kit.current(); ++kit )
{
iterator it = begin();
@ -1387,15 +1393,15 @@ bool KonqBaseListViewWidget::caseInsensitiveSort() const
}
// based on isExecuteArea from klistview.cpp
int KonqBaseListViewWidget::executeArea( QListViewItem *_item )
int KonqBaseListViewWidget::executeArea( Q3ListViewItem *_item )
{
if ( !_item )
return 0;
int width = treeStepSize() * ( _item->depth() + ( rootIsDecorated() ? 1 : 0 ) );
width += itemMargin();
int ca = AlignHorizontal_Mask & columnAlignment( 0 );
if ( ca == AlignLeft || ca == AlignAuto )
int ca = Qt::AlignHorizontal_Mask & columnAlignment( 0 );
if ( ca == Qt::AlignLeft || ca == Qt::AlignAuto )
{
width += _item->width( fontMetrics(), this, 0 );
if ( width > columnWidth( 0 ) )

View file

@ -20,8 +20,8 @@
#ifndef __konq_listviewwidget_h__
#define __konq_listviewwidget_h__
#include <qvaluelist.h>
#include <qvaluevector.h>
#include <q3valuelist.h>
#include <q3valuevector.h>
#include <kurl.h>
#include <kfileitem.h>
@ -108,7 +108,7 @@ public:
virtual bool openURL( const KURL &url );
void selectedItems( QPtrList<KonqBaseListViewItem> *_list );
void selectedItems( Q3PtrList<KonqBaseListViewItem> *_list );
KFileItemList visibleFileItems();
KFileItemList selectedFileItems();
KURL::List selectedUrls( bool mostLocal = false );
@ -122,7 +122,7 @@ public:
KonqPropsView *props() const;
//QPtrList<ColumnInfo> *columnConfigInfo() { return &confColumns; };
QValueVector<ColumnInfo>& columnConfigInfo() { return confColumns; };
Q3ValueVector<ColumnInfo>& columnConfigInfo() { return confColumns; };
QString sortedByColumn;
virtual void setShowIcons( bool enable ) { m_showIcons = enable; }
@ -153,16 +153,16 @@ signals:
public slots:
//virtual void slotOnItem( KonqBaseListViewItem* _item );
void slotMouseButtonClicked( int _button, QListViewItem *_item, const QPoint& pos, int );
virtual void slotExecuted( QListViewItem *_item );
void slotItemRenamed( QListViewItem *, const QString &, int );
void slotMouseButtonClicked( int _button, Q3ListViewItem *_item, const QPoint& pos, int );
virtual void slotExecuted( Q3ListViewItem *_item );
void slotItemRenamed( Q3ListViewItem *, const QString &, int );
protected slots:
void slotAutoScroll();
// from QListView
virtual void slotReturnPressed( QListViewItem *_item );
virtual void slotCurrentChanged( QListViewItem *_item ) { slotOnItem( _item ); }
virtual void slotReturnPressed( Q3ListViewItem *_item );
virtual void slotCurrentChanged( Q3ListViewItem *_item ) { slotOnItem( _item ); }
// slots connected to the directory lister
virtual void slotStarted();
@ -173,7 +173,7 @@ protected slots:
virtual void slotDeleteItem( KFileItem * );
virtual void slotRefreshItems( const KFileItemList & );
virtual void slotRedirection( const KURL & );
void slotPopupMenu( QListViewItem *, const QPoint&, int );
void slotPopupMenu( Q3ListViewItem *, const QPoint&, int );
// forces a repaint on column size changes / branch expansion
// when there is a background pixmap
@ -224,7 +224,7 @@ protected:
//KDirLister *dirLister() const { return m_dirLister; }
protected:
int executeArea( QListViewItem *_item );
int executeArea( Q3ListViewItem *_item );
/** The directory lister for this URL */
KDirLister *m_dirLister;
@ -234,11 +234,11 @@ protected:
//we have a fixed number of members,
//it consumes less memory and access should be faster (Alex)
// This might not be the case for ever... we should introduce custom fields in kio (David)
QValueVector<ColumnInfo> confColumns;
Q3ValueVector<ColumnInfo> confColumns;
KonqBaseListViewItem *m_dragOverItem;
KonqBaseListViewItem *m_activeItem;
QPtrList<KonqBaseListViewItem> *m_selected;
Q3PtrList<KonqBaseListViewItem> *m_selected;
QTimer *m_scrollTimer;
QFont m_itemFont;

View file

@ -24,7 +24,7 @@
#include <stdio.h>
#include <kglobal.h>
int KonqTextViewItem::compare( QListViewItem *item, int col, bool ascending ) const
int KonqTextViewItem::compare( Q3ListViewItem *item, int col, bool ascending ) const
{
if (col==1)
return KonqBaseListViewItem::compare(item, 0, ascending);

View file

@ -53,7 +53,7 @@ class KonqTextViewItem : public KonqBaseListViewItem
*/
KonqTextViewItem( KonqTextViewWidget *_parent, KFileItem* _fileitem );
virtual ~KonqTextViewItem() {/*cerr<<"~KonqTextViewItem: "<<text(1)<<endl;*/ };
virtual int compare( QListViewItem* i, int col, bool ascending ) const;
virtual int compare( Q3ListViewItem* i, int col, bool ascending ) const;
// virtual QString key( int _column, bool asc) const;
/** Call this before destroying the text view (decreases reference count
* on the view)*/

View file

@ -20,7 +20,7 @@
#include "konq_listview.h"
#include "konq_textviewitem.h"
#include <qheader.h>
#include <q3header.h>
#include <kdebug.h>
#include <kdirlister.h>
@ -67,7 +67,7 @@ void KonqTextViewWidget::createColumns()
{
addColumn( i18n("Name"), m_filenameColumnWidth );
addColumn( " ", fontMetrics().width("@") + 2 );
setColumnAlignment( 1, AlignRight );
setColumnAlignment( 1, Qt::AlignRight );
//this way the column with the name has the index 0 and
//so the "jump to filename beginning with this character" works
header()->moveSection( 0, 2 );
@ -79,7 +79,7 @@ void KonqTextViewWidget::slotNewItems( const KFileItemList & entries )
{
//kdDebug(1202) << k_funcinfo << entries.count() << endl;
for ( QPtrListIterator<KFileItem> kit ( entries ); kit.current(); ++kit )
for ( Q3PtrListIterator<KFileItem> kit ( entries ); kit.current(); ++kit )
{
KonqTextViewItem *tmp = new KonqTextViewItem( this, *kit );
if ( !m_itemFound && tmp->text(0) == m_itemToGoTo )

View file

@ -57,7 +57,7 @@ void KonqListViewDir::open( bool _open, bool _reload )
KFileItemList lst;
lst.setAutoDelete( false );
QListViewItem* it = firstChild();
Q3ListViewItem* it = firstChild();
while ( it )
{
lst.append( static_cast<KonqListViewItem*>(it)->item() );
@ -72,7 +72,7 @@ void KonqListViewDir::open( bool _open, bool _reload )
{
treeView->stopListingSubFolder( this );
QListViewItem* it = firstChild();
Q3ListViewItem* it = firstChild();
while ( it )
{
// unselect the items in the closed folder
@ -84,7 +84,7 @@ void KonqListViewDir::open( bool _open, bool _reload )
}
}
QListViewItem::setOpen( _open );
Q3ListViewItem::setOpen( _open );
treeView->slotOnViewport();
}
}

Some files were not shown because too many files have changed in this diff Show more