Fix krazy2 reported issues

svn path=/trunk/KDE/kdebase/apps/; revision=947602
This commit is contained in:
Darío Andrés Rodríguez 2009-03-31 21:06:56 +00:00
parent b38f69b859
commit 8bd2f963c9
13 changed files with 232 additions and 84 deletions

View file

@ -1,8 +1,21 @@
/***********************************************************************
*
* kdatecombo.cpp
*
***********************************************************************/
/*******************************************************************
* kdatecombo.cpp
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
******************************************************************/
#include "kdatecombo.h"
#include "kdatecombo.moc"
@ -18,7 +31,7 @@
#include <kdatetable.h>
#include <kdebug.h>
KDateCombo::KDateCombo(QWidget *parent) : QComboBox(parent)
KDateCombo::KDateCombo(QWidget *parent) : KComboBox(parent)
{
setEditable( false );
@ -26,7 +39,7 @@ KDateCombo::KDateCombo(QWidget *parent) : QComboBox(parent)
initObject(date);
}
KDateCombo::KDateCombo(const QDate & date, QWidget *parent) : QComboBox(parent)
KDateCombo::KDateCombo(const QDate & date, QWidget *parent) : KComboBox(parent)
{
setEditable( false );

View file

@ -1,16 +1,29 @@
/***********************************************************************
*
* kdatecombo.h
*
***********************************************************************/
/*******************************************************************
* kdatecombo.h
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
******************************************************************/
#ifndef KDATECOMBO_H
#define KDATECOMBO_H
#include <QtGui/QWidget>
#include <QtGui/QComboBox>
#include <QtCore/QDate>
#include <kcombobox.h>
/**
*@author Beppe Grimaldi
*/
@ -18,7 +31,7 @@
class KDatePicker;
class KPopupFrame;
class KDateCombo : public QComboBox {
class KDateCombo : public KComboBox {
Q_OBJECT
public:

View file

@ -1,15 +1,21 @@
/***********************************************************************
*
* Kfind.cpp
*
* This is KFind, released under GPL
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* KFind (c) 1998-2003 The KDE Developers
/*******************************************************************
* kfind.cpp
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* KFind (c) 1998-2003 The KDE Developers
Martin Hartig
Stephan Kulow <coolo@kde.org>
Mario Weilguni <mweilguni@sime.com>
@ -23,7 +29,7 @@
Beppe Grimaldi <grimalkin@ciaoweb.it>
Eric Coquelle <coquelle@caramail.com>
**********************************************************************/
**********************************************************************/
#include <QtGui/QLayout>
#include <QtGui/QLineEdit>

View file

@ -1,8 +1,20 @@
/***********************************************************************
*
* Kfind.h
*
***********************************************************************/
/*******************************************************************
* kfind.h
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
******************************************************************/
#ifndef KFIND_H
#define KFIND_H

View file

@ -1,8 +1,21 @@
/***********************************************************************
*
* Kfinddlg.cpp
*
**********************************************************************/
/*******************************************************************
* kfinddlg.cpp
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
******************************************************************/
#include "kfinddlg.h"
#include "kfinddlg.moc"
@ -55,7 +68,7 @@ KfindDlg::KfindDlg(const KUrl & url, QWidget *parent)
mStatusBar = new KStatusBar(frame);
mStatusBar->insertFixedItem("AMiddleLengthText...", 0);
setStatusMsg(i18n("Ready."));
setStatusMsg( i18nc("the application is currently idle, there is no active search", "Idle.") );
mStatusBar->setItemAlignment(0, Qt::AlignLeft | Qt::AlignVCenter);
mStatusBar->insertPermanentItem(QString(), 1, 1);
mStatusBar->setItemAlignment(1, Qt::AlignRight | Qt::AlignVCenter);
@ -175,7 +188,7 @@ void KfindDlg::newSearch()
void KfindDlg::slotResult(int errorCode)
{
if (errorCode == 0)
setStatusMsg(i18n("Ready."));
setStatusMsg( i18nc("the application is currently idle, there is no active search", "Idle.") );
else if (errorCode == KIO::ERR_USER_CANCELED)
setStatusMsg(i18n("Aborted."));
else if (errorCode == KIO::ERR_MALFORMED_URL)

View file

@ -1,8 +1,20 @@
/***********************************************************************
*
* KfindDlg.h
*
***********************************************************************/
/*******************************************************************
* kfinddlg.h
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
******************************************************************/
#ifndef KFINDDLG_H
#define KFINDDLG_H

View file

@ -16,6 +16,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
******************************************************************/
#include "kfindtreeview.h"
#include <QtCore/QTextStream>

View file

@ -17,8 +17,8 @@
*
******************************************************************/
#ifndef KFWIN__H
#define KFWIN__H
#ifndef KFINDTREEVIEW__H
#define KFINDTREEVIEW__H
#include <QtGui/QTreeView>
#include <QtCore/QAbstractTableModel>

View file

@ -1,8 +1,21 @@
/***********************************************************************
*
* kftabdlg.cpp
*
**********************************************************************/
/*******************************************************************
* kftabdlg.cpp
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
******************************************************************/
#include "kftabdlg.h"
#include <QtGui/QButtonGroup>
@ -12,7 +25,6 @@
#include <QtGui/QCheckBox>
#include <QtGui/QWhatsThis>
#include <QtGui/QComboBox>
#include <QtGui/QSpinBox>
#include <QtGui/QPushButton>
#include <QtGui/QApplication>
@ -29,9 +41,10 @@
#include <kservicetypetrader.h>
#include <kparts/componentfactory.h>
#include <kstandarddirs.h>
#include "kquery.h"
// Static utility functions
static void save_pattern(QComboBox *, const QString &, const QString &);
static void save_pattern(KComboBox *, const QString &, const QString &);
#define SPECIAL_TYPES 7
@ -44,7 +57,7 @@ struct LessMimeType_ByComment
};
KfindTabWidget::KfindTabWidget(QWidget *parent)
: QTabWidget( parent ), regExpDialog(0)
: KTabWidget( parent ), regExpDialog(0)
{
// This validator will be used for all numeric edit fields
//KDigitValidator *digitV = new KDigitValidator(this);
@ -57,7 +70,7 @@ KfindTabWidget::KfindTabWidget(QWidget *parent)
nameBox = new KComboBox(pages[0]);
nameBox->setEditable( true );
nameBox->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed); // allow smaller than widest entry
QLabel * namedL = new QLabel(i18n("&Named:"), pages[0]);
QLabel * namedL = new QLabel(i18nc("this is the label for the name textfield","&Named:"), pages[0]);
namedL->setBuddy( nameBox );
namedL->setObjectName( "named" );
namedL->setToolTip( i18n("You can use wildcard matching and \";\" for separating multiple names") );
@ -167,7 +180,7 @@ KfindTabWidget::KfindTabWidget(QWidget *parent)
betweenType->setObjectName( "comboBetweenType" );
betweenType->addItem(i18n("minute(s)"));
betweenType->addItem(i18n("hour(s)"));
betweenType->addItem(i18n("day(s)"));
betweenType->addItem(i18nc("use date ranges to search files by modified time","day(s)"));
betweenType->addItem(i18n("month(s)"));
betweenType->addItem(i18n("year(s)"));
betweenType->setCurrentIndex(1);
@ -209,7 +222,7 @@ KfindTabWidget::KfindTabWidget(QWidget *parent)
QLabel *groupLabel= new QLabel(i18n("Owned by &group:"),pages[1]);
groupLabel->setBuddy( m_groupBox );
sizeBox ->addItem( i18n("(none)") );
sizeBox ->addItem( i18nc("file size isn't considered in the search","(none)") );
sizeBox ->addItem( i18n("At Least") );
sizeBox ->addItem( i18n("At Most") );
sizeBox ->addItem( i18n("Equal To") );
@ -282,7 +295,7 @@ KfindTabWidget::KfindTabWidget(QWidget *parent)
typeBox->setEditable( false );
typeBox->setObjectName( "typeBox" );
typeBox->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed); // allow smaller than widest entry
QLabel * typeL =new QLabel( i18n("File &type:"), pages[2] );
QLabel * typeL =new QLabel( i18nc("label for the file type combobox","File &type:"), pages[2] );
typeL->setBuddy( typeBox );
textEdit=new KLineEdit(pages[2]);
textEdit->setClearButtonShown(true);
@ -387,7 +400,7 @@ KfindTabWidget::KfindTabWidget(QWidget *parent)
}
addTab( pages[0], i18n("Name/&Location") );
addTab( pages[2], i18n("C&ontents") );
addTab( pages[2], i18nc("tab name: search by contents","C&ontents") );
addTab( pages[1], i18n("&Properties") );
@ -541,7 +554,7 @@ void KfindTabWidget::loadHistory()
void KfindTabWidget::slotEditRegExp()
{
if ( ! regExpDialog )
regExpDialog = KServiceTypeTrader::createInstanceFromQuery<QDialog>( "KRegExpEditor/KRegExpEditor", QString(), this );
regExpDialog = KServiceTypeTrader::createInstanceFromQuery<KDialog>( "KRegExpEditor/KRegExpEditor", QString(), this );
KRegExpEditorInterface *iface = qobject_cast<KRegExpEditorInterface *>( regExpDialog );
if ( !iface )
@ -882,7 +895,7 @@ QValidator::State KDigitValidator::validate( QString & input, int & ) const
//*******************************************************
// Static utility functions
//*******************************************************
static void save_pattern(QComboBox *obj,
static void save_pattern(KComboBox *obj,
const QString & group, const QString & entry)
{
// QComboBox allows insertion of items more than specified by
@ -910,7 +923,7 @@ QSize KfindTabWidget::sizeHint() const
// Like in minicli, we changed the combobox size policy so that they can resize down,
// and then we simply provide a reasonable size hint for the whole window, depending
// on the screen width.
QSize sz = QTabWidget::sizeHint();
QSize sz = KTabWidget::sizeHint();
KfindTabWidget* me = const_cast<KfindTabWidget*>( this );
const int screenWidth = qApp->desktop()->screenGeometry(me).width();
if ( sz.width() > screenWidth / 2 )

View file

@ -1,16 +1,28 @@
/***********************************************************************
*
* kftabdlg.h
*
***********************************************************************/
/*******************************************************************
* kftabdlg.h
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
******************************************************************/
#ifndef KFTABDLG_H
#define KFTABDLG_H
#include <QtGui/QTabWidget>
#include <QtGui/QValidator> // for KDigitValidator
#include <kurl.h>
#include <ktabwidget.h>
#include <kmimetype.h>
#include "kdatecombo.h"
@ -19,19 +31,18 @@ class QButtonGroup;
class QPushButton;
class QRadioButton;
class QCheckBox;
class QLineEdit;
class KLineEdit;
class QString;
class QDate;
class QRegExp;
class QDialog;
class QComboBox;
class KDialog;
class KComboBox;
class QSpinBox;
class QLabel;
class KLineEdit;
class KfDirDialog;
class KfindTabWidget: public QTabWidget
class KfindTabWidget: public KTabWidget
{
Q_OBJECT
@ -67,21 +78,21 @@ Q_SIGNALS:
protected:
public:
QComboBox *nameBox;
QComboBox *dirBox;
KComboBox *nameBox;
KComboBox *dirBox;
// for first page
QCheckBox *subdirsCb;
QCheckBox *useLocateCb;
QCheckBox *hiddenFilesCb;
// for third page
QComboBox *typeBox;
KComboBox *typeBox;
KLineEdit * textEdit;
QCheckBox *caseSensCb;
QComboBox *m_usernameBox;
QComboBox *m_groupBox;
KComboBox *m_usernameBox;
KComboBox *m_groupBox;
//for fourth page
QLineEdit *metainfoEdit;
QLineEdit *metainfokeyEdit;
KLineEdit *metainfoEdit;
KLineEdit *metainfokeyEdit;
private:
bool isDateValid();
@ -98,7 +109,7 @@ private:
//2nd page
QCheckBox *findCreated;
QComboBox *betweenType;
KComboBox *betweenType;
QLabel *andL;
QButtonGroup *bg;
QRadioButton *rb[2];
@ -107,13 +118,13 @@ private:
QSpinBox *timeBox;
//3rd page
QComboBox *sizeBox;
QComboBox *sizeUnitBox;
KComboBox *sizeBox;
KComboBox *sizeUnitBox;
QSpinBox *sizeEdit;
QCheckBox *caseContextCb;
QCheckBox *binaryContextCb;
QCheckBox *regexpContentCb;
QDialog *regExpDialog;
KDialog *regExpDialog;
KUrl m_url;

View file

@ -1,3 +1,21 @@
/*******************************************************************
* kquery.cpp
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
******************************************************************/
#include "kquery.h"
#include <stdlib.h>

View file

@ -1,3 +1,21 @@
/*******************************************************************
* kquery.h
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
******************************************************************/
#ifndef KQUERY_H
#define KQUERY_H

View file

@ -1,3 +1,21 @@
/*******************************************************************
* main.cpp
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
******************************************************************/
#include <QtCore/QDir>
#include <QtCore/QFile>