diff options
| author | 2010-03-05 21:30:52 +0000 | |
|---|---|---|
| committer | 2010-03-05 21:30:52 +0000 | |
| commit | 494dd5de95f9e5c2433ec92450e40d3d907eac5c (patch) | |
| tree | be0e614e6a4b53163f80eb9fe85424cba5051b8d /src/modules/classeditor | |
| parent | More work on classeditor (still w.i.p.) (diff) | |
| download | KVIrc-494dd5de95f9e5c2433ec92450e40d3d907eac5c.tar.gz KVIrc-494dd5de95f9e5c2433ec92450e40d3d907eac5c.tar.bz2 KVIrc-494dd5de95f9e5c2433ec92450e40d3d907eac5c.zip | |
More work on classeditor (still w.i.p.)
git-svn-id: https://svn.kvirc.de/svn/trunk/kvirc@4096 17fca916-40b9-46aa-a4ea-0a15b648b75c
Diffstat (limited to 'src/modules/classeditor')
| -rw-r--r-- | src/modules/classeditor/classeditor.cpp | 51 | ||||
| -rw-r--r-- | src/modules/classeditor/classeditor.h | 2 |
2 files changed, 21 insertions, 32 deletions
diff --git a/src/modules/classeditor/classeditor.cpp b/src/modules/classeditor/classeditor.cpp index 14e383531..5ba90ea7e 100644 --- a/src/modules/classeditor/classeditor.cpp +++ b/src/modules/classeditor/classeditor.cpp @@ -1334,11 +1334,12 @@ void KviClassEditor::build() KviPointerHashTableIterator<QString,KviClassEditorTreeWidgetItem> it (*m_pClasses); KviPointerList<KviClassEditorTreeWidgetItem> pLinkedClasses; pLinkedClasses.setAutoDelete(false); - QStringList szClassesError; + KviPointerList<KviClassEditorTreeWidgetItem> pSkipClasses; + pSkipClasses.setAutoDelete(false); while(it.current()) { KviClassEditorTreeWidgetItem *pClass=it.current(); - if (szClassesError.indexOf(it.currentKey())!=-1){ + if (pSkipClasses.findRef(it.current())!=-1){ ++it; continue; } @@ -1351,9 +1352,9 @@ void KviClassEditor::build() pLinkedClasses.append(pClass); while(pParentClass) { - if (pParentClass->classIsModified()){ + if (pParentClass->classIsModified()) + { debug("append to build parent class %s",pParentClass->name().toUtf8().data()); - pLinkedClasses.append(pParentClass); } pParentClass=m_pClasses->find(pParentClass->inerithClass()); @@ -1379,53 +1380,41 @@ void KviClassEditor::build() debug ("class %s",szClass.toUtf8().data()); KviKvsScript::run(szClass,g_pActiveWindow); pClass = KviKvsKernel::instance()->objectController()->lookupClass(pLinkedClasses.at(i)->name()); - - if (!pClass){ - QString szError=__tr2qs_ctx("Unable to compile the class: ","classeditor"); + if (!pClass) + { + QString szError=__tr2qs_ctx("Unable to compile class: ","classeditor"); szError+=pLinkedClasses.at(i)->name()+"\n"; - QStringList szInerithedClasses; - searchInerithedClasses(pLinkedClasses.at(i)->name(),szInerithedClasses); - if (szInerithedClasses.count()) + KviPointerList<KviClassEditorTreeWidgetItem> pInerithedClasses; + searchInerithedClasses(pLinkedClasses.at(i)->name(),pInerithedClasses); + if (pInerithedClasses.count()) { - - szError+=__tr2qs_ctx("These inerithed classes will be not compiled:","classeditor"); + szError+=__tr2qs_ctx("These inerithed classes will be not compiled too:","classeditor"); szError+="\n"; - for(int j=0;j<szInerithedClasses.count();j++) + for(unsigned int j=0;j<pInerithedClasses.count();j++) { - szError+=szInerithedClasses.at(j)+"\n"; - szClassesError.append(szInerithedClasses.at(j)); + szError+=pInerithedClasses.at(j)->name()+"\n"; + pInerithedClasses.at(j)->setClassModified(true); + pSkipClasses.append(pInerithedClasses.at(j)); } } QMessageBox::critical(this,__tr2qs_ctx("Compilation error - KVIrc","classeditor"),szError, QMessageBox::Ok,QMessageBox::NoButton,QMessageBox::NoButton); break; } - + pLinkedClasses.at(i)->setClassModified(false); } } ++it; } - /* m_bSaving = true; - saveLastEditedItem(); - - KviKvsClassManager::instance()->clear(); - - for(int i=0;i<m_pTreeWidget->topLevelItemCount();i++) - { - KviClassEditorTreeWidgetItem *item=(KviClassEditorTreeWidgetItem *)m_pTreeWidget->topLevelItem(i); - recursiveCommit(item); - } - g_pApp->saveClasses(); - m_bSaving = false;*/ } -void KviClassEditor::searchInerithedClasses(const QString szClass,QStringList & szInerithed) +void KviClassEditor::searchInerithedClasses(const QString szClass,KviPointerList<KviClassEditorTreeWidgetItem> & pInerithedClasses) { KviPointerHashTableIterator<QString,KviClassEditorTreeWidgetItem> it (*m_pClasses); while(it.current()) { - if (KviQString::equalCI(szClass,it.current()->inerithClass())) szInerithed.append(it.currentKey()); + if (KviQString::equalCI(szClass,it.current()->inerithClass())) pInerithedClasses.append(it.current()); ++it; } } @@ -1435,7 +1424,7 @@ KviClassEditorWindow::KviClassEditorWindow(KviFrame * lpFrm) { g_pClassEditorWindow = this; - setFixedCaption(__tr2qs_ctx("Class Editor","editor")); + setFixedCaption(__tr2qs_ctx("Class Editor","classeditor")); QGridLayout * g = new QGridLayout(); diff --git a/src/modules/classeditor/classeditor.h b/src/modules/classeditor/classeditor.h index cf44415fc..5b25eae18 100644 --- a/src/modules/classeditor/classeditor.h +++ b/src/modules/classeditor/classeditor.h @@ -200,7 +200,7 @@ protected: void askForClassName(QString &szClassName,QString &szInerithClassName); QString askForNamespaceName(const QString &szAction,const QString &szText,const QString &szInitialText); void askForFunction(QString &szFunctionName,bool * bInternal, const QString &szClassName); - void searchInerithedClasses(const QString szClass,QStringList & szInerithed); + void searchInerithedClasses(const QString szClass,KviPointerList<KviClassEditorTreeWidgetItem> & pInerithedClasses); /* bool removeItem(KviClassEditorTreeWidgetItem *it,bool * pbYesToAll,bool bDeleteEmptyTree); |
