summaryrefslogtreecommitdiffstats
path: root/parts/astyle/astyle_part.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-14 16:45:05 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-14 16:45:05 +0000
commit48d4a26399959121f33d2bc3bfe51c7827b654fc (patch)
tree5ae5e6e00d3ba330b7b8be9bc097154b6bc739e8 /parts/astyle/astyle_part.cpp
parent7e701ace6592d09e1f2c0cf28c7d6d872d78f4f5 (diff)
downloadtdevelop-48d4a26399959121f33d2bc3bfe51c7827b654fc.tar.gz
tdevelop-48d4a26399959121f33d2bc3bfe51c7827b654fc.zip
TQt4 port kdevelop
This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdevelop@1236710 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'parts/astyle/astyle_part.cpp')
-rw-r--r--parts/astyle/astyle_part.cpp34
1 files changed, 17 insertions, 17 deletions
diff --git a/parts/astyle/astyle_part.cpp b/parts/astyle/astyle_part.cpp
index f89c2b95..de7153c1 100644
--- a/parts/astyle/astyle_part.cpp
+++ b/parts/astyle/astyle_part.cpp
@@ -36,15 +36,15 @@
static const KDevPluginInfo data("kdevastyle");
namespace {
- const char* defaultFormatExtensions = "*.cpp *.h *.hpp,*.c *.h,*.cxx *.hxx,*.c++ *.h++,*.cc *.hh,*.C *.H,*.diff ,*.inl,*.java,*.moc,*.patch,*.tlh,*.xpm";
+ const char* defaultFormatExtensions = "*.cpp *.h *.hpp,*.c *.h,*.cxx *.hxx,*.c++ *.h++,*.cc *.hh,*.C *.H,*.diff ,*.inl,*.java,*.tqmoc,*.patch,*.tlh,*.xpm";
}
typedef KDevGenericFactory<AStylePart> AStyleFactory;
K_EXPORT_COMPONENT_FACTORY( libkdevastyle, AStyleFactory( data ) )
-AStylePart::AStylePart(TQObject *parent, const char *name, const TQStringList &)
- : KDevSourceFormatter(&data, parent, name ? name : "AStylePart")
+AStylePart::AStylePart(TQObject *tqparent, const char *name, const TQStringList &)
+ : KDevSourceFormatter(&data, tqparent, name ? name : "AStylePart")
{
setInstance(AStyleFactory::instance());
@@ -193,21 +193,21 @@ void AStylePart::beautifySource()
if (m_project["Fill"].toString() == "Tabs")
{
// tabs and wsCount spaces to be a tab
- TQString replace;
+ TQString tqreplace;
for (int i =0;i<wsCount;i++)
- replace+=' ';
+ tqreplace+=' ';
- indentWith=indentWith.replace(replace, TQChar('\t'));
+ indentWith=indentWith.tqreplace(tqreplace, TQChar('\t'));
indentWith=indentWith.remove(' ');
} else
{
if ( m_project["FillForce"].toBool()){
//convert tabs to spaces
- TQString replace;
+ TQString tqreplace;
for (int i =0;i<wsCount;i++)
- replace+=' ';
+ tqreplace+=' ';
- indentWith=indentWith.replace(TQChar('\t'),replace);
+ indentWith=indentWith.tqreplace(TQChar('\t'),tqreplace);
}
}
}
@@ -323,14 +323,14 @@ void AStylePart::activePartChanged ( KParts::Part *part )
if ( iface )
{
// check for the everything case..
- if ( m_searchExtensions.find ( "*" ) == m_searchExtensions.end() )
+ if ( m_searchExtensions.tqfind ( "*" ) == m_searchExtensions.end() )
{
TQString extension = rw_part->url().path();
- int pos = extension.findRev ( '.' );
+ int pos = extension.tqfindRev ( '.' );
if ( pos >= 0 )
{
extension = extension.mid ( pos );
- enabled = ( m_searchExtensions.find ( extension ) != m_searchExtensions.end() );
+ enabled = ( m_searchExtensions.tqfind ( extension ) != m_searchExtensions.end() );
}
}
else
@@ -400,7 +400,7 @@ void AStylePart::contextMenu(TQPopupMenu *popup, const Context *context)
{
popup->insertSeparator();
int id = popup->insertItem( i18n("Format selection"), this, TQT_SLOT(beautifySource()) );
- popup->setWhatsThis(id, i18n("<b>Format</b><p>Formats the current selection, if possible"));
+ popup->TQMenuData::setWhatsThis(id, i18n("<b>Format</b><p>Formats the current selection, if possible"));
}
else if ( context->hasType( Context::FileContext )){
const FileContext *ctx = static_cast<const FileContext*>(context);
@@ -408,7 +408,7 @@ void AStylePart::contextMenu(TQPopupMenu *popup, const Context *context)
popup->insertSeparator();
int id = popup->insertItem( i18n("Format files"), this, TQT_SLOT(formatFiles()) );
- popup->setWhatsThis(id, i18n("<b>Format files</b><p>Formats selected files if possible"));
+ popup->TQMenuData::setWhatsThis(id, i18n("<b>Format files</b><p>Formats selected files if possible"));
}
}
@@ -436,7 +436,7 @@ void AStylePart::restorePartialProjectSession(const TQDomElement * el)
if ( ext.isEmpty()){
ext=defaultFormatExtensions;
}
- setExtensions(ext.replace(TQChar(','), TQChar('\n')),false);
+ setExtensions(ext.tqreplace(TQChar(','), TQChar('\n')),false);
}
}
@@ -464,7 +464,7 @@ void AStylePart::savePartialProjectSession(TQDomElement * el)
void AStylePart::formatFilesSelect(){
m_urls.clear();
- TQStringList filenames = KFileDialog::getOpenFileNames ( TQString::null, getProjectExtensions(),0,"Select files to format" );
+ TQStringList filenames = KFileDialog::getOpenFileNames ( TQString(), getProjectExtensions(),0,"Select files to format" );
for(TQStringList::Iterator it = filenames.begin(); it != filenames.end();it++){
m_urls << *it;
@@ -531,7 +531,7 @@ void AStylePart::formatFiles()
}
if ( processed != 0 )
{
- KMessageBox::information ( 0, i18n ( "Processed %1 files ending with extensions %2" ).arg ( processed ).arg(getProjectExtensions().stripWhiteSpace()) );
+ KMessageBox::information ( 0, i18n ( "Processed %1 files ending with extensions %2" ).tqarg ( processed ).tqarg(getProjectExtensions().stripWhiteSpace()) );
}
m_urls.clear();