summaryrefslogtreecommitdiffstats
path: root/quanta/dialogs/settings/filemasks.cpp
blob: 045939216a79097512afb6606466becb63cfacc5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
/***************************************************************************
                          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 masks 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 " );
   */
}