[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [Cirkuit/merge1] 6af245b: Just a test: merge branch 'master' into
From:       Matteo Agostinelli <agostinelli () gmail ! com>
Date:       2011-01-03 13:25:17
Message-ID: 20110103132517.BB897A6090 () git ! kde ! org
[Download RAW message or body]

commit 6af245bb1bc4ee8cb604f0a7d6326b56128d8994
branch merge1
Merge: 58dde12 60f5d7c
Author: Matteo Agostinelli <agostinelli@gmail.com>
Date:   Wed Dec 29 17:50:20 2010 +0100

    Just a test: merge branch 'master' into merge1
    
    Conflicts:
    	src/CMakeLists.txt
    	src/circuitmacrosmanager.cpp
    	src/lib/command.cpp
    	src/main.cpp

diff --cc src/CMakeLists.txt
index 59c6053,12b71c4..bb34476
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@@ -16,16 -14,21 +16,15 @@@ set(cirkuit_SRC
  	livepreviewwidget.cpp
  	logviewwidget.cpp
  	qimagedisplay.cpp
 -	graphicsdocument.cpp
  	circuitmacrosmanager.cpp
- 	httpdownloader.cpp
 -	graphicsgenerator.cpp
 -	command.cpp
 -	documenttemplate.cpp
 -	circuitmacrosbackend.cpp
 -	tikzbackend.cpp	
 -	gnuplotbackend.cpp
 -	settingsforms.cpp
 +	generatorthread.cpp
  )
 +
  kde4_add_kcfg_files(cirkuit_SRCS GENERATE_MOC cirkuitsettings.kcfgc)
 -kde4_add_ui_files(cirkuit_SRCS cirkuit_general_settings.ui \
cirkuit_backend_settings.ui)  +kde4_add_ui_files(cirkuit_SRCS \
cirkuit_general_settings.ui)  kde4_add_executable(cirkuit ${cirkuit_SRCS})
  
 -target_link_libraries(cirkuit ${KDE4_KDEUI_LIBS} ${KDE4_KIO_LIBS} \
${KDE4_KTEXTEDITOR_LIBS} ${POPPLER_LIBRARY} ${QT_QTNETWORK_LIBRARIES})  \
+target_link_libraries(cirkuit ${KDE4_KDEUI_LIBS} ${KDE4_KIO_LIBS} \
${KDE4_KTEXTEDITOR_LIBS} ${QT_QTNETWORK_LIBRARIES} cirkuitlibs)  
  install(TARGETS cirkuit ${INSTALL_TARGETS_DEFAULT_ARGS})
  install(FILES cirkuitui.rc 
diff --cc src/circuitmacrosmanager.h
index d3c8652,726591b..aee9d23
--- a/src/circuitmacrosmanager.h
+++ b/src/circuitmacrosmanager.h
@@@ -40,15 -37,15 +37,13 @@@ public
  
      QString installedVersion() const;
      void checkOnlineVersion();
 -    
 -    void configureIntepreter();
  
  private slots:
-     void done();
-     void progress(int,int);
-     void readmeDone();
- 
+     void unpackCircuitMacros();
      void configureCircuitMacros();
+     void readVersion();
  
-     QString findVersion(const QByteArray& byteArray) const;
+     QString findVersion(const QString& filename) const;
  
  signals:
      void newVersionAvailable(const QString&);
diff --cc src/lib/command.cpp
index 595e114,0000000..236c176
mode 100644,000000..100644
--- a/src/lib/command.cpp
+++ b/src/lib/command.cpp
@@@ -1,127 -1,0 +1,128 @@@
 +/*
 +    Copyright (C) 2011  Matteo Agostinelli <agostinelli@gmail.com>
 +
 +    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 "command.h"
 +
 +#include <QFileInfo>
 +#include <QDir>
++#include <KDebug>
 +
 +#include <KProcess>
 +#include <KStandardDirs>
 +#include <KDebug>
 +
 +using namespace Cirkuit;
 +
 +class Cirkuit::CommandPrivate {
 +public:
 +    QString name, input;
 +    QString stderr, stdout;
 +    QStringList args;
 +};
 +
 +Command::Command(const QString& name, const QString& input, const QStringList& \
args, QObject* parent): KProcess(parent), d(new CommandPrivate)  +{
 +    d->name = name;
 +    setOutputChannelMode(SeparateChannels);
 +    setInput(input);
 +    setArgs(args);
 +}
 +
 +Command::~Command()
 +{
 +    // destroy the d-pointer
 +    delete d;
 +}
 +
 +QStringList Command::args() const
 +{
 +    return d->args;
 +}
 +
 +QString Command::input() const
 +{
 +    return d->input;
 +}
 +
 +QString Command::name() const
 +{
 +    return d->name;
 +}
 +
 +void Command::setArgs(const QStringList& args)
 +{
 +    d->args = args;
 +}
 +
 +void Command::setInput(const QString& input)
 +{
 +    d->input = input;
 +}
 +
 +bool Command::execute(const QString& input, const QStringList& args)
 +{   
 +    if (!input.isEmpty()) setInput(input);
 +    if (!args.isEmpty()) setArgs(args);
 +    
 +    if (!checkExistence()) {
 +        kError() << "Program not found!!";
 +        return false;
 +    }
 +    
 +    setProgram(d->name, d->args);
 +    start();
 +    
 +    if (!waitForStarted()) {
 +        return false;
 +    }
 +    
 +    write(d->input.toLatin1());
 +    closeWriteChannel();
 +    
 +    if (!waitForFinished()) {
 +        return false;   
 +    }
 +    
 +    d->stderr = readAllStandardError();
 +    d->stdout = readAllStandardOutput();
 +    
 +    if (!d->stderr.isEmpty()) emit newStandardError(d->name, d->stderr);
 +    if (!d->stdout.isEmpty()) emit newStandardOutput(d->name, d->stderr);
 +
 +    return true;
 +}
 +
 +bool Command::checkExistence() const
 +{
 +    return KStandardDirs::findExe(d->name) != QString();
 +}
 +
 +QString Command::stdError() const
 +{
 +    return d->stderr;
 +}
 +
 +QString Command::stdOutput() const
 +{
 +    return d->stdout;
 +}
 +
 +bool Command::checkExistence(const QString& name)
 +{
 +    return KStandardDirs::findExe(name) != QString();
 +}
diff --cc src/main.cpp
index 1e35d4f,0caccf5..8a15307
--- a/src/main.cpp
+++ b/src/main.cpp
@@@ -26,7 -26,7 +26,8 @@@
  
  int main (int argc, char *argv[])
  {
 -    KAboutData aboutData( "cirkuit", "cirkuit", ki18n("Cirkuit"), "0.3.2", \
ki18n("An application to generate publication-ready figures. It is a KDE frontend for \
Circuit Macros by J. D. Aplevich, TikZ and Gnuplot. <p>Visit the <a \
href=http://www.ece.uwaterloo.ca/~aplevich/Circuit_macros>Circuit Macros</a> and <a \
href=http://www.texample.net/tikz>TikZ</a> websites for further information."), \
KAboutData::License_GPL, ki18n("(c) 2010 Matteo Agostinelli"));  +    KAboutData \
aboutData( "cirkuit", "cirkuit", ki18n("Cirkuit"), "0.4-dev", ki18n("An application \
to generate publication-ready figures. It is a KDE frontend for Circuit Macros by J. \
D. Aplevich, TikZ and Gnuplot. <p>Visit the <a \
href=http://www.ece.uwaterloo.ca/~aplevich/Circuit_macros>Circuit Macros</a> and <a \
href=http://www.texample.net/tikz>TikZ</a> websites for further information."), \
KAboutData::License_GPL, ki18n("(c) 2010 Matteo Agostinelli")); ++
      aboutData.addAuthor(ki18n("Matteo Agostinelli"), ki18n("Maintainer"), \
"matteo@agostinelli.me", "http://agostinelli.me");  \
aboutData.setHomepage("http://projects.kde.org/cirkuit");  KCmdLineArgs::init( argc, \
                argv, &aboutData );
diff --cc src/mainwindow.cpp
index d587589,4b399d1..65125ec
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@@ -312,11 -305,10 +313,11 @@@ void MainWindow::buildPreview(
      m_logViewWidget->clear();
      m_logViewWidget->hide();
      
 -    m_generator->setup(GraphicsGenerator::Source, GraphicsGenerator::QtImage, \
m_doc, m_currentFile.directory());  +    \
m_doc->setDirectory(m_currentFile.directory());  +    \
m_generator->setup(Cirkuit::Format::Source, Cirkuit::Format::QtImage, m_doc);  \
m_generator->start();  
-     qDebug() << "Preview generation in progress...";
+     kDebug() << "Preview generation in progress...";
  }
  
  void MainWindow::openPreview()


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic