Verified Commit 4f46b30f authored by Alexander Lohnau's avatar Alexander Lohnau 💬
Browse files

Remove defunct KNS upload functionality

The upload did not work for years and the component will be deprecated.
parent 5f463910
......@@ -399,7 +399,6 @@ void EditorWindow::initActions()
ParleyActions::create(ParleyActions::SearchVocabulary, this, SLOT(startSearch()), actionCollection());
ParleyActions::create(ParleyActions::ShowScriptManager, this, SLOT(slotShowScriptManager()), actionCollection());
ParleyActions::create(ParleyActions::LanguagesProperties, m_mainWindow->parleyDocument(), SLOT(languageProperties()), actionCollection());
ParleyActions::createUploadAction(m_mainWindow->parleyDocument(), SLOT(uploadFile()), actionCollection());
new EditorWindowAdaptor(this);
......
......@@ -203,12 +203,3 @@ QAction* ParleyActions::createDownloadAction(const QObject* recvr, const char* s
pAction->setToolTip(i18n("Downloads new vocabulary collections"));
return pAction;
}
QAction* ParleyActions::createUploadAction(const QObject* recvr, const char* slot, KActionCollection* collection)
{
QAction *pAction = new QAction(QIcon::fromTheme(QStringLiteral("get-hot-new-stuff")), i18n("&Upload Vocabulary Document..."), collection);
collection->addAction(QStringLiteral("file_upload"), pAction);
QObject::connect(pAction, SIGNAL(triggered(bool)), recvr, slot);
pAction->setToolTip(i18n("Share the current vocabulary collection with other users"));
return pAction;
}
......@@ -38,8 +38,6 @@ QAction* create(ParleyAction id, const QObject *recvr, const char *slot, KAction
KRecentFilesAction* createRecentFilesAction(const QObject *recvr, const char *slot, QObject *parent);
QAction* createDownloadAction(const QObject *recvr, const char *slot, KActionCollection *collection);
QAction* createUploadAction(const QObject *recvr, const char *slot, KActionCollection *collection);
}
#endif
......@@ -28,7 +28,6 @@
#else
#include <KNS3/QtQuickDialogWrapper>
#endif
#include <kns3/uploaddialog.h>
#include <KEMailSettings>
#include <KMessageBox>
#include <KProcess>
......@@ -607,43 +606,6 @@ void ParleyDocument::languageProperties()
}
}
void ParleyDocument::uploadFile()
{
// save file to temp location
QTemporaryDir dir;
if ( ! dir.isValid() ) {
KMessageBox::error(m_parleyApp, i18n("Could not create temporary directory \"%1\"", dir.path() ));
return;
}
QUrl url(QUrl::fromUserInput(dir.path() + m_doc->url().fileName()) );
qDebug() << "save in " << url;
m_doc->setGenerator(QStringLiteral("Parley"));
if ( m_doc->saveAs(url, KEduVocDocument::Automatic) != KEduVocDocument::NoError ){
KMessageBox::error(m_parleyApp, i18n("Could not save vocabulary collection \"%1\"", url.toString() ));
return;
}
KEduVocDocument tempDoc(this);
if ( tempDoc.open(url) != KEduVocDocument::NoError ) {
KMessageBox::error(m_parleyApp, i18n("Could not open vocabulary collection \"%1\"", url.toString() ));
return;
}
// remove grades
tempDoc.lesson()->resetGrades(-1, KEduVocContainer::Recursive);
m_doc->setGenerator(QStringLiteral("Parley"));
if ( tempDoc.saveAs(url, KEduVocDocument::Automatic) != KEduVocDocument::NoError ) {
KMessageBox::error(m_parleyApp, i18n("Could not save vocabulary collection \"%1\"", url.toString() ));
return;
}
// upload
KNS3::UploadDialog dialog(ParleyMainWindow::instance());
dialog.setUploadFile(url);
dialog.exec();
}
void ParleyDocument::exportDialog()
{
#ifdef HAVE_LIBXSLT
......
......@@ -48,8 +48,6 @@ public slots:
void openGHNS();
/** download new vocabularies */
void slotGHNS();
/** upload the current file */
void uploadFile();
/** Opens the given url, displays an error message and returns false on failure */
bool open(const QUrl &);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment