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

svn path=/trunk/KDE/kdebase/apps/; revision=679363
This commit is contained in:
Jeremy Paul Whiting 2007-06-23 18:53:52 +00:00
parent 8ef3884263
commit a185ac263e
40 changed files with 68 additions and 66 deletions

View file

@ -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,

View file

@ -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;
};

View file

@ -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());

View file

@ -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);

View file

@ -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;

View file

@ -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();

View file

@ -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

View file

@ -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)

View file

@ -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

View file

@ -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();

View file

@ -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:

View file

@ -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))

View file

@ -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;

View file

@ -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;

View file

@ -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();

View file

@ -15,7 +15,7 @@
#include <klocale.h>
NewTypeDialog::NewTypeDialog(QStringList groups,
NewTypeDialog::NewTypeDialog(const QStringList &groups,
QWidget *parent, const char *name)
: KDialog( parent )
{

View file

@ -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;

View file

@ -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;

View file

@ -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;

View file

@ -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),

View file

@ -83,7 +83,7 @@ class KJavaOptions : public KCModule
Q_OBJECT
public:
KJavaOptions( KSharedConfig::Ptr config, QString group, const KComponentData &componentData, QWidget* parent );
KJavaOptions( KSharedConfig::Ptr config, const QString &group, const KComponentData &componentData, QWidget* parent );
virtual void load();
virtual void save();

View file

@ -36,7 +36,7 @@
// == class KJavaScriptOptions =====
KJavaScriptOptions::KJavaScriptOptions( KSharedConfig::Ptr config, QString group, const KComponentData &componentData, QWidget *parent) :
KJavaScriptOptions::KJavaScriptOptions( KSharedConfig::Ptr config, const QString &group, const KComponentData &componentData, QWidget *parent) :
KCModule(componentData, parent),
_removeJavaScriptDomainAdvice(false),
m_pConfig( config ), m_groupname( group ),

View file

@ -49,7 +49,7 @@ class KJavaScriptOptions : public KCModule
{
Q_OBJECT
public:
KJavaScriptOptions( KSharedConfig::Ptr config, QString group, const KComponentData &componentData, QWidget* parent );
KJavaScriptOptions( KSharedConfig::Ptr config, const QString &group, const KComponentData &componentData, QWidget* parent );
virtual void load();
virtual void save();

View file

@ -12,7 +12,7 @@
#include <kglobal.h>
KHTTPOptions::KHTTPOptions(KSharedConfig::Ptr config, QString group, const KComponentData &componentData, QWidget *parent)
KHTTPOptions::KHTTPOptions(KSharedConfig::Ptr config, const QString &group, const KComponentData &componentData, QWidget *parent)
: KCModule( componentData, parent ), m_pConfig(config), m_groupname(group)
{
QVBoxLayout *lay = new QVBoxLayout(this);

View file

@ -19,7 +19,7 @@ class KHTTPOptions : public KCModule
{
Q_OBJECT
public:
KHTTPOptions(KSharedConfig::Ptr config, QString group, const KComponentData &componentData, QWidget *parent);
KHTTPOptions(KSharedConfig::Ptr config, const QString &group, const KComponentData &componentData, QWidget *parent);
virtual void load();
virtual void save();

View file

@ -856,7 +856,7 @@ void Sidebar_Widget::mousePressEvent(QMouseEvent *ev)
m_menu->exec(QCursor::pos());
}
KonqSidebarPlugin *Sidebar_Widget::loadModule(QWidget *par,QString &desktopName,QString lib_name,ButtonInfo* bi)
KonqSidebarPlugin *Sidebar_Widget::loadModule(QWidget *par,QString &desktopName,const QString &lib_name,ButtonInfo* bi)
{
KLibLoader *loader = KLibLoader::self();

View file

@ -182,7 +182,7 @@ private:
QSplitter *splitter() const;
bool addButton(const QString &desktoppath,int pos=-1);
bool createView(ButtonInfo *data);
KonqSidebarPlugin *loadModule(QWidget *par,QString &desktopName,QString lib_name,ButtonInfo *bi);
KonqSidebarPlugin *loadModule(QWidget *par,QString &desktopName,const QString &lib_name,ButtonInfo *bi);
void readConfig();
void initialCopy();
void doLayout();

View file

@ -346,7 +346,7 @@ void KonqSidebarBookmarkModule::slotDelete()
KonqBookmarkManager::self()->emitChanged( parentBookmark );
}
void makeTextNodeMod(KBookmark bk, const QString &m_nodename, const QString &m_newText) {
void makeTextNodeMod(const KBookmark &bk, const QString &m_nodename, const QString &m_newText) {
QDomNode subnode = bk.internalElement().namedItem(m_nodename);
if (subnode.isNull()) {
subnode = bk.internalElement().ownerDocument().createElement(m_nodename);
@ -503,7 +503,7 @@ void KonqSidebarBookmarkModule::fillListView()
m_ignoreOpenChange = false;
}
void KonqSidebarBookmarkModule::fillGroup( KonqSidebarTreeItem * parentItem, KBookmarkGroup group )
void KonqSidebarBookmarkModule::fillGroup( KonqSidebarTreeItem * parentItem, const KBookmarkGroup &group )
{
int n = 0;
for ( KBookmark bk = group.first() ; !bk.isNull() ; bk = group.next(bk), ++n )

View file

@ -61,7 +61,7 @@ protected Q_SLOTS:
protected:
void fillListView();
void fillGroup( KonqSidebarTreeItem * parentItem, KBookmarkGroup group );
void fillGroup( KonqSidebarTreeItem * parentItem, const KBookmarkGroup &group );
KonqSidebarBookmarkItem * findByAddress( const QString & address ) const;
private Q_SLOTS:

View file

@ -57,7 +57,7 @@
static const int autoOpenTimeout = 750;
getModule KonqSidebarTree::getPluginFactory(QString name)
getModule KonqSidebarTree::getPluginFactory(const QString &name)
{
if (!pluginFactories.contains(name))
{
@ -361,18 +361,19 @@ void KonqSidebarTree::contentsDropEvent( QDropEvent *ev )
}
}
static QString findUniqueFilename(const QString &path, QString filename)
static QString findUniqueFilename(const QString &path, const QString &filename)
{
if (filename.endsWith(".desktop"))
filename.truncate(filename.length()-8);
QString tempFilename = filename;
if (tempFilename.endsWith(".desktop"))
tempFilename.truncate(tempFilename.length()-8);
QString name = filename;
QString name = tempFilename;
int n = 2;
while(QFile::exists(path + filename + ".desktop"))
while(QFile::exists(path + tempFilename + ".desktop"))
{
filename = QString("%2_%1").arg(n++).arg(name);
tempFilename = QString("%2_%1").arg(n++).arg(name);
}
return path+filename+".desktop";
return path+tempFilename+".desktop";
}
void KonqSidebarTree::addUrl(KonqSidebarTreeTopLevelItem* item, const KUrl & url)

View file

@ -190,7 +190,7 @@ private:
bool m_scrollingLocked;
getModule getPluginFactory(QString name);
getModule getPluginFactory(const QString &name);
QMap<QString, QString> pluginInfo;
QMap<QString, getModule> pluginFactories;

View file

@ -99,7 +99,7 @@ KonqMainWindow * KonqMisc::createSimpleWindow( const KUrl & url, const KParts::U
return win;
}
KonqMainWindow * KonqMisc::createNewWindow( const KUrl &url, const KParts::URLArgs &args, bool forbidUseHTML, QStringList filesToSelect, bool tempFile, bool openUrl )
KonqMainWindow * KonqMisc::createNewWindow( const KUrl &url, const KParts::URLArgs &args, bool forbidUseHTML, const QStringList &filesToSelect, bool tempFile, bool openUrl )
{
kDebug() << "KonqMisc::createNewWindow url=" << url << endl;

View file

@ -69,7 +69,7 @@ public:
static KonqMainWindow * createNewWindow( const KUrl &url,
const KParts::URLArgs &args = KParts::URLArgs(),
bool forbidUseHTML = false,
QStringList filesToSelect = QStringList(),
const QStringList &filesToSelect = QStringList(),
bool tempFile = false,
bool openUrl = true);

View file

@ -1082,7 +1082,7 @@ bool KonqView::callExtensionBoolMethod( const char *methodName, bool value )
return true;
}
bool KonqView::callExtensionStringMethod( const char *methodName, QString value )
bool KonqView::callExtensionStringMethod( const char *methodName, const QString &value )
{
QObject *obj = KParts::BrowserExtension::childObject( m_pPart );
if ( !obj ) // not all views have a browser extension !

View file

@ -293,7 +293,7 @@ public:
// return true if the method was found, false if the execution failed
bool callExtensionMethod( const char *methodName );
bool callExtensionBoolMethod( const char *methodName, bool value );
bool callExtensionStringMethod( const char *methodName, QString value );
bool callExtensionStringMethod( const char *methodName, const QString &value );
bool callExtensionURLMethod( const char *methodName, const KUrl& value );
void setViewName( const QString &name );

View file

@ -357,7 +357,7 @@ void PluginPart::evalJavaScript(int id, const QString & script)
}
}
void PluginPart::statusMessage(QString msg)
void PluginPart::statusMessage(const QString &msg)
{
kDebug(1422) << "PluginPart::statusMessage " << msg << endl;
emit setStatusBarText(msg);

View file

@ -86,7 +86,7 @@ public:
// CallBack interface (DBus-exported)
void postURL(const QString& url, const QString& target, const QByteArray& data, const QString& mime);
void requestURL(const QString& url, const QString& target);
void statusMessage( QString msg );
void statusMessage( const QString &msg );
void evalJavaScript( int id, const QString& script );
void reloadPage();

View file

@ -96,7 +96,7 @@ extern "C" void __pure_virtual()
KConfig *infoConfig = 0;
bool isPluginMimeType( QString fname )
bool isPluginMimeType( const QString &fname )
{
KDesktopFile cfg( fname );
return cfg.desktopGroup().hasKey( "X-KDE-nsplugin" );
@ -140,7 +140,7 @@ void deletePluginMimeTypes()
}
void generateMimeType( QString mime, QString extensions, QString pluginName, QString description )
void generateMimeType( const QString &mime, const QString &extensions, const QString &pluginName, const QString &description )
{
kDebug(1433) << "-> generateMimeType mime=" << mime << " ext="<< extensions << endl;
@ -283,7 +283,7 @@ int tryCheck(int write_fd, const QString &absFile)
return 0;
}
void scanDirectory( QString dir, QStringList &mimeInfoList,
void scanDirectory( const QString &dir, QStringList &mimeInfoList,
QTextStream &cache )
{
kDebug(1433) << "-> scanDirectory dir=" << dir << endl;
@ -474,7 +474,7 @@ QStringList getSearchPaths()
}
void writeServicesFile( QStringList mimeTypes )
void writeServicesFile( const QStringList &mimeTypes )
{
QString fname = KGlobal::dirs()->saveLocation("services", "")
+ "/nsplugin.desktop";

View file

@ -582,8 +582,8 @@ static int s_instanceCounter = 0;
NSPluginInstance::NSPluginInstance(NPP privateData, NPPluginFuncs *pluginFuncs,
KLibrary *handle, int width, int height,
QString src, QString /*mime*/,
QString appId, QString callbackId,
const QString &src, const QString &/*mime*/,
const QString &appId, const QString &callbackId,
bool embed,
QObject *parent )
: QObject( parent )
@ -1006,7 +1006,7 @@ void NSPluginInstance::resizePlugin(int w, int h)
}
void NSPluginInstance::javascriptResult(int id, QString result) {
void NSPluginInstance::javascriptResult(int id, const QString &result) {
QMap<int, Request*>::iterator i = _jsrequests.find( id );
if (i != _jsrequests.end()) {
Request *req = i.value();
@ -1175,7 +1175,7 @@ int32 NSPluginInstance::NPWriteReady(NPStream *stream)
}
void NSPluginInstance::NPURLNotify(QString url, NPReason reason, void *notifyData)
void NSPluginInstance::NPURLNotify(const QString &url, NPReason reason, void *notifyData)
{
if (!_pluginFuncs.urlnotify)
return;

View file

@ -157,8 +157,8 @@ public:
// constructor, destructor
NSPluginInstance( NPP privateData, NPPluginFuncs *pluginFuncs, KLibrary *handle,
int width, int height, QString src, QString mime,
QString appId, QString callbackId, bool embed,
int width, int height, const QString &src, const QString &mime,
const QString &appId, const QString &callbackId, bool embed,
QObject *parent );
~NSPluginInstance();
@ -167,7 +167,7 @@ public:
int winId() { return XtWindow(_form); }
int setWindow(int remove=0);
void resizePlugin(int w, int h);
void javascriptResult(int id, QString result);
void javascriptResult(int id, const QString &result);
void displayPlugin();
// value handling
@ -185,7 +185,7 @@ public:
int32 NPWriteReady(NPStream *stream);
// URL functions
void NPURLNotify(QString url, NPReason reason, void *notifyData);
void NPURLNotify(const QString &url, NPReason reason, void *notifyData);
// Event handling
uint16 HandleEvent(void *event);