Commit 2b1d1224 authored by Jeremy Whiting's avatar Jeremy Whiting
Browse files

krazy const & checks fix by Kristho, with a couple modifications so it works, thanks Kris!

svn path=/trunk/KDE/kdebase/apps/; revision=679363
parent ebda846d
......@@ -128,7 +128,7 @@ ChFaceDlg::ChFaceDlg(const QString& picsdir, QWidget *parent, const char *name,
resize( 420, 400 );
}
void ChFaceDlg::addCustomPixmap( QString imPath, bool saveCopy )
void ChFaceDlg::addCustomPixmap( const QString &imPath, bool saveCopy )
{
QImage pix( imPath );
// TODO: save pix to TMPDIR/userinfo-tmp,
......
......@@ -64,7 +64,7 @@ private Q_SLOTS:
//void slotSaveCustomImage();
private:
void addCustomPixmap( QString imPath, bool saveCopy );
void addCustomPixmap( const QString &imPath, bool saveCopy );
K3IconView *m_FacesWidget;
};
......
......@@ -31,7 +31,7 @@
#include <kdesu/process.h>
PasswdProcess::PasswdProcess(QByteArray user)
PasswdProcess::PasswdProcess(const QByteArray &user)
{
struct passwd *pw;
......@@ -251,7 +251,7 @@ int PasswdProcess::ConversePasswd(const char *oldpass, const char *newpass,
}
bool PasswdProcess::isPrompt(QByteArray line, const char *word)
bool PasswdProcess::isPrompt(const QByteArray &line, const char *word)
{
unsigned i, j, colon;
unsigned int lineLength(line.length());
......
......@@ -20,7 +20,7 @@ class PasswdProcess
: public PtyProcess
{
public:
PasswdProcess(QByteArray user = QByteArray());
PasswdProcess(const QByteArray &user = QByteArray());
~PasswdProcess();
enum Errors { PasswdNotFound=1, PasswordIncorrect, PasswordNotGood };
......@@ -31,7 +31,7 @@ public:
QByteArray error() { return m_Error; }
private:
bool isPrompt(QByteArray line, const char *word=0L);
bool isPrompt(const QByteArray &line, const char *word=0L);
int ConversePasswd(const char *oldpass, const char *newpass,
int check);
......
......@@ -76,7 +76,7 @@ int KDEpasswd1Dialog::getPassword(QByteArray &password)
KDEpasswd2Dialog::KDEpasswd2Dialog(const char *oldpass, QByteArray user)
KDEpasswd2Dialog::KDEpasswd2Dialog(const char *oldpass, const QByteArray &user)
: KNewPasswordDialog()
{
m_Pass = oldpass;
......
......@@ -34,7 +34,7 @@ class KDEpasswd2Dialog
Q_OBJECT
public:
KDEpasswd2Dialog(const char *oldpass, QByteArray user);
KDEpasswd2Dialog(const char *oldpass, const QByteArray &user);
~KDEpasswd2Dialog();
void accept();
......
......@@ -93,7 +93,7 @@ static KCmdLineOptions options[] =
{ "separate-output", I18N_NOOP("Return list items on separate lines (for checklist option and file open with --multiple)"), 0 },
{ "print-winid", I18N_NOOP("Outputs the winId of each dialog"), 0 },
{ "embed <winid>", I18N_NOOP("Makes the dialog transient for an X app specified by winid"), 0 },
{ "dontagain <file:entry>", I18N_NOOP("Config file and option name for saving the \"dont-show/ask-again\" state"), 0 },
{ "dontagain <file:entry>", I18N_NOOP("Config file and option name for saving the \"don't-show/ask-again\" state"), 0 },
{ "+[arg]", I18N_NOOP("Arguments - depending on main option"), 0 },
KCmdLineLastOption
......
......@@ -80,12 +80,13 @@ bool KDateCombo::setDate(const QDate & newDate)
return false;
}
void KDateCombo::dateEnteredEvent(QDate newDate)
void KDateCombo::dateEnteredEvent(const QDate &newDate)
{
if (!newDate.isValid())
newDate = datePicker->date();
QDate tempDate = newDate;
if (!tempDate.isValid())
tempDate = datePicker->date();
popupFrame->hide();
setDate(newDate);
setDate(tempDate);
}
void KDateCombo::mousePressEvent (QMouseEvent * e)
......
......@@ -43,7 +43,7 @@ protected:
virtual void mousePressEvent (QMouseEvent * e);
protected Q_SLOTS:
void dateEnteredEvent(QDate d=QDate());
void dateEnteredEvent(const QDate &d=QDate());
};
#endif
......@@ -45,7 +45,7 @@ KonqyPreloader::~KonqyPreloader()
updateCount();
}
bool KonqyPreloader::registerPreloadedKonqy( QString id, int screen )
bool KonqyPreloader::registerPreloadedKonqy( const QString &id, int screen )
{
if( instances.count() >= KonqSettings::maxPreloadCount() )
return false;
......@@ -72,7 +72,7 @@ QString KonqyPreloader::getPreloadedKonqy( int screen )
return "";
}
void KonqyPreloader::unregisterPreloadedKonqy( QString id_P )
void KonqyPreloader::unregisterPreloadedKonqy( const QString &id_P )
{
for( InstancesList::Iterator it = instances.begin();
it != instances.end();
......
......@@ -32,9 +32,9 @@ class KonqyPreloader
virtual ~KonqyPreloader();
public Q_SLOTS:
bool registerPreloadedKonqy( QString id, int screen );
bool registerPreloadedKonqy( const QString &id, int screen );
QString getPreloadedKonqy( int screen );
void unregisterPreloadedKonqy( QString id );
void unregisterPreloadedKonqy( const QString &id );
void reconfigure();
void unloadAllPreloaded();
private Q_SLOTS:
......
......@@ -6,7 +6,7 @@
#include <QtCore/QFile>
#include <QtCore/QTextStream>
bool CSSTemplate::expand(QString destname, const QMap<QString,QString> &dict)
bool CSSTemplate::expand(const QString &destname, const QMap<QString,QString> &dict)
{
QFile inf(_filename);
if (!inf.open(QIODevice::ReadOnly))
......
......@@ -9,7 +9,7 @@ class CSSTemplate
public:
CSSTemplate(QString fname) : _filename(fname) {}
bool expand(QString destname, const QMap<QString,QString> &dict);
bool expand(const QString &destname, const QMap<QString,QString> &dict);
protected:
QString _filename;
......
......@@ -162,7 +162,7 @@ void FileTypeDetails::updateRemoveButton()
removeExtButton->setEnabled(extensionLB->count()>0);
}
void FileTypeDetails::updateIcon(QString icon)
void FileTypeDetails::updateIcon(const QString &icon)
{
if (!m_item)
return;
......
......@@ -36,7 +36,7 @@ Q_SIGNALS:
void changed(bool);
protected Q_SLOTS:
void updateIcon(QString icon);
void updateIcon(const QString &icon);
void updateDescription(const QString &desc);
void addExtension();
void removeExtension();
......
......@@ -15,7 +15,7 @@
#include <klocale.h>
NewTypeDialog::NewTypeDialog(QStringList groups,
NewTypeDialog::NewTypeDialog(const QStringList &groups,
QWidget *parent, const char *name)
: KDialog( parent )
{
......
......@@ -17,7 +17,7 @@ class QComboBox;
class NewTypeDialog : public KDialog
{
public:
explicit NewTypeDialog(QStringList groups, QWidget *parent = 0,
explicit NewTypeDialog(const QStringList &groups, QWidget *parent = 0,
const char *name = 0);
QString group() const;
QString text() const;
......
......@@ -66,7 +66,7 @@ struct CookieProp
bool allLoaded;
};
CookieListViewItem::CookieListViewItem(Q3ListView *parent, QString dom)
CookieListViewItem::CookieListViewItem(Q3ListView *parent, const QString &dom)
:Q3ListViewItem(parent)
{
init( 0, dom );
......@@ -83,7 +83,7 @@ CookieListViewItem::~CookieListViewItem()
delete mCookie;
}
void CookieListViewItem::init( CookieProp* cookie, QString domain,
void CookieListViewItem::init( CookieProp* cookie, const QString &domain,
bool cookieLoaded )
{
mCookie = cookie;
......
......@@ -47,7 +47,7 @@ public:
class CookieListViewItem : public Q3ListViewItem
{
public:
CookieListViewItem(Q3ListView *parent, QString dom);
CookieListViewItem(Q3ListView *parent, const QString &dom);
CookieListViewItem(Q3ListViewItem *parent, CookieProp *cookie);
~CookieListViewItem();
......@@ -60,7 +60,7 @@ public:
private:
void init( CookieProp* cookie,
QString domain = QString(),
const QString &domain = QString(),
bool cookieLoaded=false );
CookieProp *mCookie;
QString mDomain;
......
......@@ -52,7 +52,7 @@ JavaPolicies::~JavaPolicies() {
// == class KJavaOptions =====
KJavaOptions::KJavaOptions( KSharedConfig::Ptr config, QString group,
KJavaOptions::KJavaOptions( KSharedConfig::Ptr config, const QString &group,
const KComponentData &componentData, QWidget *parent )
: KCModule( componentData, parent ),
_removeJavaScriptDomainAdvice(false),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment