summaryrefslogtreecommitdiffstats
path: root/quanta/dialogs/settings/filemasks.cpp
blob: fee135f834e9e905c9df33531ab939b902c36f73 (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
/***************************************************************************
                          filesmask.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 *parent, const char *name)
  :FileMasksS(parent,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.contains("text"))
    {
      if (!markup.contains(name) && !script.contains(name))
         text += name+"; ";
    }
    if (name.contains("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 " );
   */
}