Ulrich Van Den Hekke 11 years ago
parent
commit
ee4557fc5b
  1. 28
      framework/core/filewatcher.cpp
  2. 2
      framework/core/p_filewatcher.h
  3. 79
      plugins/core/editors/models/xsl/importitemmodelfactory.cpp
  4. 60
      plugins/core/editors/models/xsl/importitemmodelfactory.h
  5. 11
      setup/xinx-setup.iss

28
framework/core/filewatcher.cpp

@ -49,14 +49,27 @@ bool FileWatched::isFileChanged() @@ -49,14 +49,27 @@ bool FileWatched::isFileChanged()
FileWatcherManager::FileWatcherManager()
{
XINXStaticDeleter::self()->addObject(this);
}
FileWatcherManager::~FileWatcherManager()
{
if (s_self == this)
{
s_self = 0;
}
if (isRunning())
{
quit();
wait();
}
for (int i = 0 ; i < m_watchedfiles.count() ; i++)
{
delete m_watchedfiles.at(i);
}
m_watchedfiles.clear();
}
@ -131,21 +144,6 @@ FileWatcherManager * FileWatcherManager::instance() @@ -131,21 +144,6 @@ FileWatcherManager * FileWatcherManager::instance()
return s_self;
}
void FileWatcherManager::deleteIfPossible()
{
if (s_self && (s_self->m_watchedfiles.count() == 0))
{
FileWatcherManager * manager = s_self;
s_self = NULL;
if (manager->isRunning())
{
manager->quit();
manager->wait();
}
delete manager;
}
}
FileWatched * FileWatcherManager::watchedFileAt(int index)
{
return m_watchedfiles.at(index);

2
framework/core/p_filewatcher.h

@ -91,13 +91,13 @@ public: @@ -91,13 +91,13 @@ public:
FileWatched * watchedFileAt(int index);
static FileWatcherManager * instance();
static void deleteIfPossible();
public slots:
void watch();
signals:
void fileChanged(QString filename);
void directoryChanged(QString directory);
private:
static QAtomicInt _ref;
static FileWatcherManager * s_self;
QMutex m_watchedFilesMutex;
QList<FileWatched*> m_watchedfiles;

79
plugins/core/editors/models/xsl/importitemmodelfactory.cpp

@ -0,0 +1,79 @@ @@ -0,0 +1,79 @@
/*
XINX
Copyright (C) 2007-2010 by Ulrich Van Den Hekke
xinx@shadoware.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 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful.
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "importitemmodelfactory.h"
#include <editors/models/html_xsl_base/xmlcontexttype.h>
#include <codecompletion/model.h>
#include <contentview3/definitions.h>
#include <contentview3/file.h>
#include <contentview3/filenode.h>
#include <contentview3/cache.h>
#include <project/xinxprojectproject.h>
#include "stylesheet_templatenode.h"
#include "stylesheet_paramnode.h"
#include "stylesheet_variablenode.h"
#include "editors/models/html_xsl_base/xmlcontexttype.h"
#include <qdocumentcursor.h>
#include <editors/textfileeditor.h>
#include <editors/xinxcodeedit.h>
namespace Core
{
namespace Stylesheet
{
/* ImportItemModelFactory */
ImportItemModelFactory::ImportItemModelFactory()
{
}
ImportItemModelFactory::~ImportItemModelFactory()
{
}
void ItemModelFactory::addNode(const QString & path)
{
}
void ItemModelFactory::generate()
{
Core::BaliseDefinition::XmlContextType * c = dynamic_cast<Core::BaliseDefinition::XmlContextType*>(context().context(XML_CONTEXT_TYPE));
if (c && c->position() == Core::BaliseDefinition::XmlContextType::ATTRIBUTE_CONTENT)
{
ContentView3::FilePtr file = context().fileStrongRef();
XinxProject::ProjectPtr project = file->project();
addNode(QFileInfo(file->filename()).absoluteFilePath ());
if (project)
{
addNode(project->projectPath());
}
}
}
}
}

60
plugins/core/editors/models/xsl/importitemmodelfactory.h

@ -0,0 +1,60 @@ @@ -0,0 +1,60 @@
/*
XINX
Copyright (C) 2007-2010 by Ulrich Van Den Hekke
xinx@shadoware.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 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful.
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef CORE_STYLESHEET_IMPORTITEMMODELFACTORY_H
#define CORE_STYLESHEET_IMPORTITEMMODELFACTORY_H
#include <codecompletion/itemmodelfactory.h>
#include <QApplication>
#include <contentview3/definitions.h>
#include <codecompletion/model.h>
namespace Core
{
namespace BaliseDefinition
{
class XmlContextType;
class XmlBalise;
}
};
namespace Core
{
namespace Stylesheet
{
class ImportItemModelFactory : public CodeCompletion::ItemModelFactory
{
Q_DECLARE_TR_FUNCTIONS(ImportItemModelFactory)
public:
ImportItemModelFactory();
virtual ~ImportItemModelFactory();
virtual void generate();
private:
void addNode(const QString & path);
};
}
}
#endif // CORE_STYLESHEET_ITEMMODELFACTORY_H

11
setup/xinx-setup.iss

@ -52,6 +52,7 @@ Name: assofws; Description: Associate WebServices stream with {#AppName}; Flags: @@ -52,6 +52,7 @@ Name: assofws; Description: Associate WebServices stream with {#AppName}; Flags:
Source: ..\COPYING; DestDir: {app}; Components: application
Source: install\bin\xinx.exe; DestDir: {app}\bin; Components: application; Flags: replacesameversion
Source: install\bin\xinxcrash.exe; DestDir: {app}\bin; Components: application; Flags: replacesameversion
Source: install\bin\libxinxcmp.dll; DestDir: {app}\bin; Components: application; Flags: replacesameversion
Source: install\bin\libframework.dll; DestDir: {app}\bin; Components: application; Flags: replacesameversion
Source: install\bin\libqcodeedit.dll; DestDir: {app}\bin; Components: application; Flags: replacesameversion
@ -86,11 +87,11 @@ DestDir: {app}\templates; Source: ..\templates\*.xml; Components: application @@ -86,11 +87,11 @@ DestDir: {app}\templates; Source: ..\templates\*.xml; Components: application
Source: ..\src.7z; DestDir: {app}; Components: source; Flags: replacesameversion
;Source: ..\doc\html\*.*; DestDir: {app}\doc\api; Components: documentation; Flags: replacesameversion
DestDir: {app}\plugins; Source: install\plugins\libservices.dll; Components: services
DestDir: {app}\plugins; Source: install\plugins\libcvsplugin.dll; Components: cvsplugin
DestDir: {app}\plugins; Source: install\plugins\libsvnplugin.dll; Components: svnplugin
DestDir: {app}\plugins; Source: install\plugins\libsvnpluginwrapper.dll; Components: svnpluginwrapper
DestDir: {app}\plugins; Source: install\plugins\libgenerix.dll; Components: generixplugin
DestDir: {app}\plugins; Source: install\plugins\libservices.dll; Components: services; Flags: replacesameversion
DestDir: {app}\plugins; Source: install\plugins\libcvsplugin.dll; Components: cvsplugin; Flags: replacesameversion
DestDir: {app}\plugins; Source: install\plugins\libsvnplugin.dll; Components: svnplugin; Flags: replacesameversion
DestDir: {app}\plugins; Source: install\plugins\libsvnpluginwrapper.dll; Components: svnpluginwrapper; Flags: replacesameversion
DestDir: {app}\plugins; Source: install\plugins\libgenerix.dll; Components: generixplugin; Flags: replacesameversion
DestDir: {app}\scripts; Source: ..\scripts\*.js; Components: scripts

Loading…
Cancel
Save