Commit 1f7665c2 authored by Stephan Kulow's avatar Stephan Kulow
Browse files

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
parent ae0c7c27
......@@ -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 );
......
......@@ -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();
......
......@@ -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();
......
......@@ -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
......@@ -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;
}
......
......@@ -22,6 +22,10 @@
#include <kcmodule.h>
#include "main_widget.h"
//Added by qt3to4:
#include <QPixmap>
#include <QEvent>
#include <QDropEvent>
class KAboutData;
class KUser;
......
......@@ -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>
......
......@@ -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);
......
......@@ -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);
}
......@@ -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;
};
......
......@@ -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)));
}
......
......@@ -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;
};
......
......@@ -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;
......
......@@ -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();
}
......
......@@ -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;
};
......
......@@ -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]);