~ubuntu-branches/ubuntu/vivid/regina-normal/vivid-proposed

« back to all changes in this revision

Viewing changes to kdeui/src/part/foreign/sourcehandler.cpp

  • Committer: Package Import Robot
  • Author(s): Ben Burton
  • Date: 2011-09-10 07:17:25 UTC
  • mfrom: (1.2.4 upstream)
  • Revision ID: package-import@ubuntu.com-20110910071725-97n90tywdq60w2cr
Tags: 4.90-1
* New upstream release!
* The user interface has been ported from KDE3 to KDE4 (closes: #556318).
  Re-enabled the GUI as a result.
* The build system has been ported from autotools to cmake.
* The new upstream release builds fine on amd64 (closes: #624882).
* Moved the users' handbook into regina-normal-doc.
* Upgraded several suggests/recommends.  Upgraded regina-normal-mpi to
  depend on mpi-default-bin, and regina-normal to depend on both graphviz
  and regina-normal-doc (which the GUI expends to be present).  Upgraded
  regina-normal to recommend gap.
* Bumped standards-version to 3.9.2.0 (no changes required).

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
 *  Regina - A Normal Surface Theory Calculator                           *
5
5
 *  KDE User Interface                                                    *
6
6
 *                                                                        *
7
 
 *  Copyright (c) 1999-2009, Ben Burton                                   *
 
7
 *  Copyright (c) 1999-2011, Ben Burton                                   *
8
8
 *  For further details contact Ben Burton (bab@debian.org).              *
9
9
 *                                                                        *
10
10
 *  This program is free software; you can redistribute it and/or         *
35
35
#include <klocale.h>
36
36
#include <kmessagebox.h>
37
37
#include <qfile.h>
 
38
#include <qtextcodec.h>
38
39
#include <qtextstream.h>
39
40
 
40
41
const SourceHandler SourceHandler::instance;
53
54
    regina::NTriangulation* tri = dynamic_cast<regina::NTriangulation*>(data);
54
55
 
55
56
    QFile f(fileName);
56
 
    if (! f.open(IO_WriteOnly)) {
 
57
    if (! f.open(QIODevice::WriteOnly)) {
57
58
        KMessageBox::error(parentWidget, i18n(
58
59
            "This triangulation could not be exported.  The target "
59
60
            "file %1 could not be opened for writing.").arg(fileName));
64
65
    if (encoding)
65
66
        out.setCodec(encoding);
66
67
    else
67
 
        out.setEncoding(QTextStream::UnicodeUTF8);
 
68
        out.setCodec(QTextCodec::codecForName("UTF-8"));
68
69
 
69
 
    out << tri->dumpConstruction();
 
70
    out << tri->dumpConstruction().c_str();
70
71
    return true;
71
72
}
72
73