|
|
@ -67,7 +67,7 @@ bool Manager::copyAppData(const KURL& src, const TQString& subdir, const TQStrin
|
|
|
|
TQString dir;
|
|
|
|
TQString dir;
|
|
|
|
//let saveLocation find and create the appropriate place to
|
|
|
|
//let saveLocation find and create the appropriate place to
|
|
|
|
//store the templates (usually $HOME/.trinity/share/apps/kile/templates)
|
|
|
|
//store the templates (usually $HOME/.trinity/share/apps/kile/templates)
|
|
|
|
dir = KGlobal::dirs()->saveLocation("appdata", subdir, true);
|
|
|
|
dir = TDEGlobal::dirs()->saveLocation("appdata", subdir, true);
|
|
|
|
KURL targetURL = KURL::fromPathOrURL(dir);
|
|
|
|
KURL targetURL = KURL::fromPathOrURL(dir);
|
|
|
|
targetURL.addPath(fileName);
|
|
|
|
targetURL.addPath(fileName);
|
|
|
|
|
|
|
|
|
|
|
@ -152,7 +152,7 @@ bool Manager::replace(const KileTemplate::Info& toBeReplaced, const KURL& newTem
|
|
|
|
|
|
|
|
|
|
|
|
void Manager::scanForTemplates() {
|
|
|
|
void Manager::scanForTemplates() {
|
|
|
|
KILE_DEBUG() << "===scanForTemplates()===================" << endl;
|
|
|
|
KILE_DEBUG() << "===scanForTemplates()===================" << endl;
|
|
|
|
TQStringList dirs = KGlobal::dirs()->findDirs("appdata", "templates");
|
|
|
|
TQStringList dirs = TDEGlobal::dirs()->findDirs("appdata", "templates");
|
|
|
|
TQDir templates;
|
|
|
|
TQDir templates;
|
|
|
|
KileTemplate::Info ti;
|
|
|
|
KileTemplate::Info ti;
|
|
|
|
KileDocument::Extensions *extensions = m_kileInfo->extensions();
|
|
|
|
KileDocument::Extensions *extensions = m_kileInfo->extensions();
|
|
|
@ -167,7 +167,7 @@ void Manager::scanForTemplates() {
|
|
|
|
TQFileInfo fileInfo(ti.path);
|
|
|
|
TQFileInfo fileInfo(ti.path);
|
|
|
|
ti.name = fileInfo.baseName(true).mid(9); //remove "template_", do it this way to avoid problems with user input!
|
|
|
|
ti.name = fileInfo.baseName(true).mid(9); //remove "template_", do it this way to avoid problems with user input!
|
|
|
|
ti.type = extensions->determineDocumentType(KURL::fromPathOrURL(ti.path));
|
|
|
|
ti.type = extensions->determineDocumentType(KURL::fromPathOrURL(ti.path));
|
|
|
|
ti.icon = KGlobal::dirs()->findResource("appdata","pics/type_" + ti.name + extensions->defaultExtensionForDocumentType(ti.type) + ".kileicon");
|
|
|
|
ti.icon = TDEGlobal::dirs()->findResource("appdata","pics/type_" + ti.name + extensions->defaultExtensionForDocumentType(ti.type) + ".kileicon");
|
|
|
|
if (m_TemplateList.contains(ti))
|
|
|
|
if (m_TemplateList.contains(ti))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
KILE_DEBUG() << "\tignoring: " << ti.path << endl;
|
|
|
|
KILE_DEBUG() << "\tignoring: " << ti.path << endl;
|
|
|
@ -268,34 +268,34 @@ void TemplateIconView::searchLaTeXClassFiles()
|
|
|
|
|
|
|
|
|
|
|
|
delete m_proc;
|
|
|
|
delete m_proc;
|
|
|
|
|
|
|
|
|
|
|
|
m_proc = new KProcess(TQT_TQOBJECT(this));
|
|
|
|
m_proc = new TDEProcess(TQT_TQOBJECT(this));
|
|
|
|
m_proc->clearArguments();
|
|
|
|
m_proc->clearArguments();
|
|
|
|
m_proc->setUseShell(true);
|
|
|
|
m_proc->setUseShell(true);
|
|
|
|
(*m_proc) << TQStringList::split(' ', command);
|
|
|
|
(*m_proc) << TQStringList::split(' ', command);
|
|
|
|
m_output = TQString();
|
|
|
|
m_output = TQString();
|
|
|
|
|
|
|
|
|
|
|
|
connect(m_proc, TQT_SIGNAL(receivedStdout(KProcess*,char*,int)),
|
|
|
|
connect(m_proc, TQT_SIGNAL(receivedStdout(TDEProcess*,char*,int)),
|
|
|
|
this, TQT_SLOT(slotProcessOutput(KProcess*,char*,int)) );
|
|
|
|
this, TQT_SLOT(slotProcessOutput(TDEProcess*,char*,int)) );
|
|
|
|
connect(m_proc, TQT_SIGNAL(receivedStderr(KProcess*,char*,int)),
|
|
|
|
connect(m_proc, TQT_SIGNAL(receivedStderr(TDEProcess*,char*,int)),
|
|
|
|
this, TQT_SLOT(slotProcessOutput(KProcess*,char*,int)) );
|
|
|
|
this, TQT_SLOT(slotProcessOutput(TDEProcess*,char*,int)) );
|
|
|
|
connect(m_proc, TQT_SIGNAL(processExited(KProcess*)),
|
|
|
|
connect(m_proc, TQT_SIGNAL(processExited(TDEProcess*)),
|
|
|
|
this, TQT_SLOT(slotProcessExited(KProcess*)) );
|
|
|
|
this, TQT_SLOT(slotProcessExited(TDEProcess*)) );
|
|
|
|
|
|
|
|
|
|
|
|
KILE_DEBUG() << "=== NewFileWidget::searchClassFiles() ====================" << endl;
|
|
|
|
KILE_DEBUG() << "=== NewFileWidget::searchClassFiles() ====================" << endl;
|
|
|
|
KILE_DEBUG() << "\texecute: " << command << endl;
|
|
|
|
KILE_DEBUG() << "\texecute: " << command << endl;
|
|
|
|
if ( ! m_proc->start(KProcess::NotifyOnExit, KProcess::AllOutput) )
|
|
|
|
if ( ! m_proc->start(TDEProcess::NotifyOnExit, TDEProcess::AllOutput) )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
KILE_DEBUG() << "\tstart of shell process failed" << endl;
|
|
|
|
KILE_DEBUG() << "\tstart of shell process failed" << endl;
|
|
|
|
addTemplateIcons(KileDocument::LaTeX);
|
|
|
|
addTemplateIcons(KileDocument::LaTeX);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void TemplateIconView::slotProcessOutput(KProcess*, char* buf, int len)
|
|
|
|
void TemplateIconView::slotProcessOutput(TDEProcess*, char* buf, int len)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
m_output += TQString::fromLocal8Bit(buf,len);
|
|
|
|
m_output += TQString::fromLocal8Bit(buf,len);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void TemplateIconView::slotProcessExited(KProcess *proc)
|
|
|
|
void TemplateIconView::slotProcessExited(TDEProcess *proc)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if ( ! proc->normalExit() )
|
|
|
|
if ( ! proc->normalExit() )
|
|
|
|
m_output = TQString();
|
|
|
|
m_output = TQString();
|
|
|
@ -308,7 +308,7 @@ void TemplateIconView::addTemplateIcons(KileDocument::Type type)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if(!m_templateManager) return;
|
|
|
|
if(!m_templateManager) return;
|
|
|
|
|
|
|
|
|
|
|
|
TQString emptyIcon = KGlobal::dirs()->findResource("appdata", "pics/"+ TQString(DEFAULT_EMPTY_ICON) + ".png" );
|
|
|
|
TQString emptyIcon = TDEGlobal::dirs()->findResource("appdata", "pics/"+ TQString(DEFAULT_EMPTY_ICON) + ".png" );
|
|
|
|
|
|
|
|
|
|
|
|
KileTemplate::Info emptyDocumentInfo;
|
|
|
|
KileTemplate::Info emptyDocumentInfo;
|
|
|
|
emptyDocumentInfo.name = DEFAULT_EMPTY_CAPTION;
|
|
|
|
emptyDocumentInfo.name = DEFAULT_EMPTY_CAPTION;
|
|
|
|