mirror of
https://invent.kde.org/system/dolphin
synced 2024-11-05 18:47:12 +00:00
Coolo: I fixed a little bug and deleted some warnings.
Miroslav told me, that he has currently no time. svn path=/trunk/kdebase/kfind/; revision=188
This commit is contained in:
parent
2cf41a965c
commit
72bda9bb0a
7 changed files with 21 additions and 19 deletions
|
@ -13,6 +13,7 @@
|
||||||
#include <qapp.h>
|
#include <qapp.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <qaccel.h>
|
#include <qaccel.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include <kmsgbox.h>
|
#include <kmsgbox.h>
|
||||||
|
|
||||||
|
@ -72,7 +73,7 @@ KfindMenu::KfindMenu( QWidget *parent, const char *name )
|
||||||
CHECK_PTR( options );
|
CHECK_PTR( options );
|
||||||
// options->setFont(menu_font );
|
// options->setFont(menu_font );
|
||||||
|
|
||||||
int prefs = options->insertItem("Preferences ...",this,SIGNAL(prefs()));
|
options->insertItem("Preferences ...",this,SIGNAL(prefs()));
|
||||||
/*
|
/*
|
||||||
int saving = options->insertItem("Saving " ,this,SIGNAL(saving()));
|
int saving = options->insertItem("Saving " ,this,SIGNAL(saving()));
|
||||||
int archives = options->insertItem("Archives " ,this,SIGNAL(archives()));
|
int archives = options->insertItem("Archives " ,this,SIGNAL(archives()));
|
||||||
|
|
|
@ -39,7 +39,7 @@ extern QList<KfFileType> *types;
|
||||||
extern KfSaveOptions *saving;
|
extern KfSaveOptions *saving;
|
||||||
extern QList<KfArchiver> *archivers;
|
extern QList<KfArchiver> *archivers;
|
||||||
|
|
||||||
KfOptions::KfOptions( QWidget *parent=0, const char *name=0 ):QTabDialog()
|
KfOptions::KfOptions( QWidget *parent=0, const char *name=0 ):QTabDialog( parent, name)
|
||||||
{
|
{
|
||||||
resize(400,330);
|
resize(400,330);
|
||||||
insertPages();
|
insertPages();
|
||||||
|
|
|
@ -227,7 +227,6 @@ void KfindTabDialog::init(const char *searchPath = 0 )
|
||||||
void KfindTabDialog::resizeEvent( QResizeEvent *ev )
|
void KfindTabDialog::resizeEvent( QResizeEvent *ev )
|
||||||
{
|
{
|
||||||
int w = width();
|
int w = width();
|
||||||
int h = height();
|
|
||||||
int wTmp;
|
int wTmp;
|
||||||
QRect rTmp;
|
QRect rTmp;
|
||||||
|
|
||||||
|
@ -336,7 +335,7 @@ void KfindTabDialog::enableCheckedEdit()
|
||||||
|
|
||||||
void KfindTabDialog::isCheckedValid()
|
void KfindTabDialog::isCheckedValid()
|
||||||
{
|
{
|
||||||
int match,len;
|
int match, len;
|
||||||
QRegExp date("[0-9][0-9]?[/][0-9][0-9]?[/][0-9][0-9][0-9][0-9]");
|
QRegExp date("[0-9][0-9]?[/][0-9][0-9]?[/][0-9][0-9][0-9][0-9]");
|
||||||
QRegExp r("[0-9]+");
|
QRegExp r("[0-9]+");
|
||||||
|
|
||||||
|
@ -345,14 +344,14 @@ void KfindTabDialog::isCheckedValid()
|
||||||
bool rightDates = TRUE;
|
bool rightDates = TRUE;
|
||||||
|
|
||||||
match = date.match(le[0]->text(), 0,&len);
|
match = date.match(le[0]->text(), 0,&len);
|
||||||
if ( !(match != -1 && len == strlen(le[0]->text())) )
|
if ( !(match != -1 && len == (int)strlen(le[0]->text())) )
|
||||||
rightDates=FALSE;
|
rightDates=FALSE;
|
||||||
|
|
||||||
if ( string2Date(le[0]->text()).isNull() )
|
if ( string2Date(le[0]->text()).isNull() )
|
||||||
rightDates=FALSE;
|
rightDates=FALSE;
|
||||||
|
|
||||||
match = date.match(le[1]->text(), 0,&len);
|
match = date.match(le[1]->text(), 0,&len);
|
||||||
if ( !(match != -1 && len == strlen(le[1]->text())) )
|
if ( !(match != -1 && len == (int)strlen(le[1]->text())) )
|
||||||
rightDates=FALSE;
|
rightDates=FALSE;
|
||||||
|
|
||||||
if ( string2Date(le[1]->text()).isNull() )
|
if ( string2Date(le[1]->text()).isNull() )
|
||||||
|
@ -374,7 +373,7 @@ void KfindTabDialog::isCheckedValid()
|
||||||
if (prevMonth == TRUE)
|
if (prevMonth == TRUE)
|
||||||
{
|
{
|
||||||
match = r.match(le[2]->text(), 0,&len);
|
match = r.match(le[2]->text(), 0,&len);
|
||||||
if ( !(match != -1 && len == strlen(le[2]->text())) )
|
if ( !(match != -1 && len == (int)strlen(le[2]->text())) )
|
||||||
{
|
{
|
||||||
QMessageBox mb(this,"message box");
|
QMessageBox mb(this,"message box");
|
||||||
mb.setText( "The month(s) value isn't valid!!");
|
mb.setText( "The month(s) value isn't valid!!");
|
||||||
|
@ -386,7 +385,7 @@ void KfindTabDialog::isCheckedValid()
|
||||||
if (prevDay == TRUE)
|
if (prevDay == TRUE)
|
||||||
{
|
{
|
||||||
match = r.match(le[3]->text(), 0,&len);
|
match = r.match(le[3]->text(), 0,&len);
|
||||||
if (! (match != -1 && len == strlen(le[3]->text())) )
|
if (! (match != -1 && len == (int)strlen(le[3]->text())) )
|
||||||
{
|
{
|
||||||
QMessageBox mb(this,"message box");
|
QMessageBox mb(this,"message box");
|
||||||
mb.setText( "The day(s) value isn't valid!!");
|
mb.setText( "The day(s) value isn't valid!!");
|
||||||
|
@ -403,7 +402,7 @@ void KfindTabDialog::checkSize()
|
||||||
QRegExp r("[0-9]+");
|
QRegExp r("[0-9]+");
|
||||||
|
|
||||||
match = r.match(sizeEdit->text(), 0,&len);
|
match = r.match(sizeEdit->text(), 0,&len);
|
||||||
if ( !(match != -1 && len == strlen(sizeEdit->text())) )
|
if ( !(match != -1 && len == (int)strlen(sizeEdit->text())) )
|
||||||
{
|
{
|
||||||
QMessageBox mb(this,"message box");
|
QMessageBox mb(this,"message box");
|
||||||
mb.setText( "The value in size isn't valid number!!");
|
mb.setText( "The value in size isn't valid number!!");
|
||||||
|
|
|
@ -26,7 +26,7 @@ void KfFileType::initFileTypes( const char* _path )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Loop thru all directory entries
|
// Loop thru all directory entries
|
||||||
while ( ep = readdir( dp ) )
|
while ( ( ep = readdir( dp ) ) != NULL )
|
||||||
{
|
{
|
||||||
if ( strcmp( ep->d_name, "." ) != 0 && strcmp( ep->d_name, ".." ) != 0 )
|
if ( strcmp( ep->d_name, "." ) != 0 && strcmp( ep->d_name, ".." ) != 0 )
|
||||||
{
|
{
|
||||||
|
|
|
@ -50,7 +50,7 @@ public:
|
||||||
The return value may be 0L if there is no comment at all.
|
The return value may be 0L if there is no comment at all.
|
||||||
This method does not use _url but some overloading methods do so.
|
This method does not use _url but some overloading methods do so.
|
||||||
*/
|
*/
|
||||||
virtual QString getComment( const char *_url )
|
virtual QString getComment( const char * )
|
||||||
{ return QString( comment.data() ); }
|
{ return QString( comment.data() ); }
|
||||||
|
|
||||||
/// Sets the comment
|
/// Sets the comment
|
||||||
|
|
|
@ -160,7 +160,7 @@ void KfindWindow::saveResults()
|
||||||
item=0;
|
item=0;
|
||||||
while(item!=items)
|
while(item!=items)
|
||||||
{
|
{
|
||||||
fprintf(results,"%s\n", lbx->text(item),lbx->text(item));
|
fprintf(results,"%s\n", lbx->text(item));
|
||||||
item++;
|
item++;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -209,9 +209,9 @@ void KfindWindow::deleteFiles()
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
KFM *PropertiesD= new KFM();
|
KFM *PropertiesD= new KFM();
|
||||||
QFileInfo *fileInfo = new QFileInfo(lbx->text(
|
/* QFileInfo *fileInfo = new QFileInfo(lbx->text(
|
||||||
lbx->currentItem()));
|
lbx->currentItem()));
|
||||||
|
*/
|
||||||
PropertiesD->refreshDirectory(lbx->text(lbx->currentItem()));
|
PropertiesD->refreshDirectory(lbx->text(lbx->currentItem()));
|
||||||
lbx->removeItem(lbx->currentItem());
|
lbx->removeItem(lbx->currentItem());
|
||||||
};
|
};
|
||||||
|
@ -242,9 +242,9 @@ void KfindWindow::deleteFiles()
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
KFM *PropertiesD= new KFM();
|
KFM *PropertiesD= new KFM();
|
||||||
QFileInfo *fileInfo = new QFileInfo(lbx->text(
|
/* QFileInfo *fileInfo = new QFileInfo(lbx->text(
|
||||||
lbx->currentItem()));
|
lbx->currentItem()));
|
||||||
|
*/
|
||||||
PropertiesD->refreshDirectory(lbx->text(lbx->currentItem()));
|
PropertiesD->refreshDirectory(lbx->text(lbx->currentItem()));
|
||||||
lbx->removeItem(lbx->currentItem());
|
lbx->removeItem(lbx->currentItem());
|
||||||
};
|
};
|
||||||
|
@ -258,7 +258,7 @@ void KfindWindow::fileProperties()
|
||||||
{
|
{
|
||||||
KFM *PropertiesD= new KFM();
|
KFM *PropertiesD= new KFM();
|
||||||
|
|
||||||
QFileInfo *fileInfo = new QFileInfo(lbx->text(lbx->currentItem()));
|
// QFileInfo *fileInfo = new QFileInfo(lbx->text(lbx->currentItem()));
|
||||||
|
|
||||||
PropertiesD->openProperties(lbx->text(lbx->currentItem()));
|
PropertiesD->openProperties(lbx->text(lbx->currentItem()));
|
||||||
};
|
};
|
||||||
|
|
|
@ -41,8 +41,10 @@ int main( int argc, char ** argv )
|
||||||
break;
|
break;
|
||||||
};
|
};
|
||||||
|
|
||||||
if (i==argc)
|
if (i==argc) {
|
||||||
searchPath = getcwd(searchPath.data(),0);
|
char buffer[1000];
|
||||||
|
searchPath = getcwd(buffer, 0);
|
||||||
|
};
|
||||||
|
|
||||||
if ( searchPath.isNull() )
|
if ( searchPath.isNull() )
|
||||||
searchPath = getenv( "HOME" );
|
searchPath = getenv( "HOME" );
|
||||||
|
|
Loading…
Reference in a new issue