summaryrefslogtreecommitdiffstats
path: root/languages/java/javasupportpart.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 /languages/java/javasupportpart.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 'languages/java/javasupportpart.cpp')
-rw-r--r--languages/java/javasupportpart.cpp67
1 files changed, 20 insertions, 47 deletions
diff --git a/languages/java/javasupportpart.cpp b/languages/java/javasupportpart.cpp
index 62d4811f..e8f62fa1 100644
--- a/languages/java/javasupportpart.cpp
+++ b/languages/java/javasupportpart.cpp
@@ -118,8 +118,8 @@ public:
}
};
-JavaSupportPart::JavaSupportPart(TQObject *parent, const char *name, const TQStringList &/*args*/)
- : KDevLanguageSupport(JavaSupportFactory::info(), parent, name ? name : "KDevJavaSupport"),
+JavaSupportPart::JavaSupportPart(TQObject *tqparent, const char *name, const TQStringList &/*args*/)
+ : KDevLanguageSupport(JavaSupportFactory::info(), tqparent, name ? name : "KDevJavaSupport"),
m_activeDocument( 0 ), m_activeView( 0 ), m_activeSelection( 0 ), m_activeEditor( 0 ),
m_activeViewCursor( 0 ), m_projectClosed( true ), m_valid( false )
{
@@ -267,13 +267,13 @@ void JavaSupportPart::activePartChanged(KParts::Part *part)
m_activeSelection = dynamic_cast<KTextEditor::SelectionInterface*>( part );
m_activeViewCursor = part ? dynamic_cast<KTextEditor::ViewCursorInterface*>( m_activeView ) : 0;
- m_activeFileName = TQString::null;
+ m_activeFileName = TQString();
if (m_activeDocument) {
m_activeFileName = URLUtil::canonicalPath( m_activeDocument->url().path() );
TQFileInfo fi( m_activeFileName );
TQString ext = fi.extension();
- if (fileExtensions().contains(ext))
+ if (fileExtensions().tqcontains(ext))
enabled = true;
}
@@ -395,7 +395,7 @@ void JavaSupportPart::savedFile(const KURL &fileName)
kdDebug(9013) << "savedFile(): " << fileName.mid ( m_projectDirectory.length() + 1 ) << endl;
TQStringList projectFileList = project()->allFiles();
- if (projectFileList.contains(fileName.mid ( m_projectDirectory.length() + 1 ))) {
+ if (projectFileList.tqcontains(fileName.mid ( m_projectDirectory.length() + 1 ))) {
maybeParse( fileName );
emit addedSourceInfo( fileName );
}
@@ -481,25 +481,6 @@ void JavaSupportPart::initialParse( )
return;
}
-#if QT_VERSION < 0x030100
-// Taken from qt-3.2/tools/qdatetime.java/TQDateTime::toTime_t() and modified for normal function
-uint toTime_t(TQDateTime t)
-{
- tm brokenDown;
- brokenDown.tm_sec = t.time().second();
- brokenDown.tm_min = t.time().minute();
- brokenDown.tm_hour = t.time().hour();
- brokenDown.tm_mday = t.date().day();
- brokenDown.tm_mon = t.date().month() - 1;
- brokenDown.tm_year = t.date().year() - 1900;
- brokenDown.tm_isdst = -1;
- int secsSince1Jan1970UTC = (int) mktime( &brokenDown );
- if ( secsSince1Jan1970UTC < -1 )
- secsSince1Jan1970UTC = -1;
- return (uint) secsSince1Jan1970UTC;
-}
-#endif
-
bool
JavaSupportPart::parseProject( )
{
@@ -524,7 +505,7 @@ JavaSupportPart::parseProject( )
TQDir d( m_projectDirectory );
TQDataStream stream;
- TQMap< TQString, QPair<uint, uint> > pcs;
+ TQMap< TQString, TQPair<uint, uint> > pcs;
if( TQFileInfo( project()->projectDirectory() + "/" +
project()->projectName().lower() + ".kdevelop.pcs" ).exists() )
@@ -550,7 +531,7 @@ JavaSupportPart::parseProject( )
uint offset;
stream >> fn >> ts >> offset;
- pcs[ fn ] = qMakePair( ts, offset );
+ pcs[ fn ] = tqMakePair( ts, offset );
}
}
}
@@ -575,15 +556,11 @@ JavaSupportPart::parseProject( )
if( isValidSource(absFilePath) ){
TQDateTime t = fileInfo.lastModified();
- if( m_timestamp.contains(absFilePath) && m_timestamp[absFilePath] == t )
+ if( m_timestamp.tqcontains(absFilePath) && m_timestamp[absFilePath] == t )
continue;
-#if QT_VERSION >= 0x030100
- if( pcs.contains(absFilePath) && t.toTime_t() == pcs[absFilePath].first ){
-#else
- if( pcs.contains(absFilePath) && toTime_t(t) == pcs[absFilePath].first ){
-#endif
- stream.device()->at( pcs[absFilePath].second );
+ if( pcs.tqcontains(absFilePath) && t.toTime_t() == pcs[absFilePath].first ){
+ stream.tqdevice()->at( pcs[absFilePath].second );
FileDom file = codeModel()->create<FileModel>();
file->read( stream );
codeModel()->addFile( file );
@@ -630,7 +607,7 @@ void JavaSupportPart::maybeParse( const TQString& fileName )
return;
}
- TQMap<TQString, TQDateTime>::Iterator it = m_timestamp.find( path );
+ TQMap<TQString, TQDateTime>::Iterator it = m_timestamp.tqfind( path );
if( it != m_timestamp.end() && *it == t ){
return;
}
@@ -689,12 +666,12 @@ TQStringList JavaSupportPart::modifiedFileList()
TQFileInfo fileInfo( m_projectDirectory, fileName );
- if( !fileExtensions().contains(fileInfo.extension()) )
+ if( !fileExtensions().tqcontains(fileInfo.extension()) )
continue;
TQDateTime t = fileInfo.lastModified();
TQString path = URLUtil::canonicalPath( fileInfo.absFilePath() );
- TQMap<TQString, TQDateTime>::Iterator dictIt = m_timestamp.find( path );
+ TQMap<TQString, TQDateTime>::Iterator dictIt = m_timestamp.tqfind( path );
if( fileInfo.exists() && dictIt != m_timestamp.end() && *dictIt == t )
continue;
@@ -792,7 +769,7 @@ void JavaSupportPart::setPcsVersion( int version )
TQString JavaSupportPart::formatTag( const Tag & /*inputTag*/ )
{
- return TQString::null;
+ return TQString();
}
void JavaSupportPart::removeWithReferences( const TQString & fileName )
@@ -810,7 +787,7 @@ void JavaSupportPart::removeWithReferences( const TQString & fileName )
bool JavaSupportPart::isValidSource( const TQString& fileName ) const
{
TQFileInfo fileInfo( fileName );
- return fileExtensions().contains( fileInfo.extension() ) && !TQFile::exists(fileInfo.dirPath(true) + "/.kdev_ignore");
+ return fileExtensions().tqcontains( fileInfo.extension() ) && !TQFile::exists(fileInfo.dirPath(true) + "/.kdev_ignore");
}
TQString JavaSupportPart::formatModelItem( const CodeModelItem *item, bool shortDescription )
@@ -882,26 +859,22 @@ void JavaSupportPart::saveProjectSourceInfo( )
stream << int( fileList.size() );
for( FileList::ConstIterator it=fileList.begin(); it!=fileList.end(); ++it ){
const FileDom dom = (*it);
-#if QT_VERSION >= 0x030100
stream << dom->name() << m_timestamp[ dom->name() ].toTime_t();
-#else
- stream << dom->name() << toTime_t(m_timestamp[ dom->name() ]);
-#endif
- offsets.insert( dom->name(), stream.device()->at() );
+ offsets.insert( dom->name(), stream.tqdevice()->at() );
stream << (uint)0; // dummy offset
}
for( FileList::ConstIterator it=fileList.begin(); it!=fileList.end(); ++it ){
const FileDom dom = (*it);
- int offset = stream.device()->at();
+ int offset = stream.tqdevice()->at();
dom->write( stream );
- int end = stream.device()->at();
+ int end = stream.tqdevice()->at();
- stream.device()->at( offsets[dom->name()] );
+ stream.tqdevice()->at( offsets[dom->name()] );
stream << offset;
- stream.device()->at( end );
+ stream.tqdevice()->at( end );
}
}