You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
68 lines
2.4 KiB
68 lines
2.4 KiB
/***************************************************************************
|
|
filestqmask.cpp - description
|
|
-------------------
|
|
begin : Fri May 19 2000
|
|
copyright : (C) 2000 by Yacovlev Alexander & Dmitry Poplavsky <pdima@mail.univ.kiev.ua>
|
|
(C) 2002 Andras Mantia <amantia@kde.org>
|
|
***************************************************************************/
|
|
|
|
/***************************************************************************
|
|
* *
|
|
* 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. *
|
|
* *
|
|
***************************************************************************/
|
|
#include "filemasks.h"
|
|
#include "filemasks.moc"
|
|
// qt includes
|
|
#include <tqlineedit.h>
|
|
#include <tqpushbutton.h>
|
|
|
|
//kde includes
|
|
#include <kmimetype.h>
|
|
|
|
FileMasks::FileMasks(TQWidget *tqparent, const char *name)
|
|
:FileMasksS(tqparent,name)
|
|
{
|
|
connect(buttonDefault, TQT_SIGNAL(clicked()), this, TQT_SLOT(setToDefault()));
|
|
}
|
|
|
|
FileMasks::~FileMasks(){
|
|
}
|
|
/** set tqmasks to default */
|
|
void FileMasks::setToDefault()
|
|
{
|
|
KMimeType::List list = KMimeType::allMimeTypes();
|
|
KMimeType::List::iterator it;
|
|
TQString markup, script, image, text;
|
|
markup = "text/css; text/html; text/sgml; text/xml; ";
|
|
script = "text/x-perl; text/x-python; text/x-php; text/x-java; text/x-asp; ";
|
|
TQString name;
|
|
for ( it = list.begin(); it != list.end(); ++it )
|
|
{
|
|
name = (*it)->name();
|
|
if (name.tqcontains("text"))
|
|
{
|
|
if (!markup.tqcontains(name) && !script.tqcontains(name))
|
|
text += name+"; ";
|
|
}
|
|
if (name.tqcontains("image"))
|
|
{
|
|
image += name +"; ";
|
|
}
|
|
}
|
|
lineMarkup->setText(markup);
|
|
lineScript->setText(script);
|
|
lineImage->setText(image);
|
|
lineText->setText(text);
|
|
|
|
/*
|
|
lineHTML->setText("*.*html *.*htm *.php* *.asp *.cfm *.css *.inc* *.*HTML *.*HTM *.PHP* *.ASP *.CFM *.CSS *.INC* ");
|
|
linePHP->setText( "*.php* *.PHP*" );
|
|
lineImages->setText("*.gif *.jpg *.png *.jpeg *.bmp *.GIF *.JPG *.PNG *.JPEG *.BMP ");
|
|
lineText->setText( "*.txt *.TXT " );
|
|
*/
|
|
}
|