diff options
author | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
---|---|---|
committer | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
commit | 114a878c64ce6f8223cfd22d76a20eb16d177e5e (patch) | |
tree | acaf47eb0fa12142d3896416a69e74cbf5a72242 /buildtools/script/scriptoptionswidget.cpp | |
download | tdevelop-114a878c64ce6f8223cfd22d76a20eb16d177e5e.tar.gz tdevelop-114a878c64ce6f8223cfd22d76a20eb16d177e5e.zip |
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdevelop@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'buildtools/script/scriptoptionswidget.cpp')
-rw-r--r-- | buildtools/script/scriptoptionswidget.cpp | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/buildtools/script/scriptoptionswidget.cpp b/buildtools/script/scriptoptionswidget.cpp new file mode 100644 index 00000000..c1660b00 --- /dev/null +++ b/buildtools/script/scriptoptionswidget.cpp @@ -0,0 +1,69 @@ +/*************************************************************************** + * Copyright (C) 2002 by Bernd Gehrmann * + * bernd@kdevelop.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 "scriptoptionswidget.h" + +#include <qcheckbox.h> +#include <klineedit.h> +#include <qradiobutton.h> +#include <qtabwidget.h> +#include "domutil.h" +#include "kdevlanguagesupport.h" + + +ScriptOptionsWidget::ScriptOptionsWidget(KDevPlugin *part, + QWidget *parent, const char *name) + : ScriptOptionsWidgetBase(parent, name) +{ + m_part = part; + + QDomDocument &dom = *m_part->projectDom(); + + QString includepatterns + = DomUtil::readEntry(dom, "/kdevscriptproject/general/includepatterns"); + + if (includepatterns.isNull() && part->languageSupport()){ + QStringList includepatternList; + KMimeType::List list = part->languageSupport()->mimeTypes(); + KMimeType::List::Iterator it = list.begin(); + while( it != list.end() ){ + includepatternList += (*it)->patterns(); + ++it; + } + includepatterns = includepatternList.join( "," ); + } + + QString excludepatterns + = DomUtil::readEntry(dom, "/kdevscriptproject/general/excludepatterns"); + if (excludepatterns.isNull()) + excludepatterns = "*~"; + + includepatterns_edit->setText(includepatterns); + excludepatterns_edit->setText(excludepatterns); +} + + +ScriptOptionsWidget::~ScriptOptionsWidget() +{} + + +void ScriptOptionsWidget::accept() +{ + QDomDocument &dom = *m_part->projectDom(); + + QString includepatterns = includepatterns_edit->text(); + QString excludepatterns = excludepatterns_edit->text(); + + DomUtil::writeEntry(dom, "/kdevscriptproject/general/includepatterns", includepatterns); + DomUtil::writeEntry(dom, "/kdevscriptproject/general/excludepatterns", excludepatterns); +} + +#include "scriptoptionswidget.moc" |