publishercreator.cpp
author jake
Mon, 23 Aug 2010 14:05:40 +0300
changeset 4 63928ff6db8d
parent 2 0c23d71853fe
permissions -rw-r--r--
Added the setting file, which enables the automatic launch of the publisher. Fixed the issues with the .pkg files.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
b856a9924bbc initial contribution
jake
parents:
diff changeset
     1
#include <QFile>
b856a9924bbc initial contribution
jake
parents:
diff changeset
     2
#include <QDir>
b856a9924bbc initial contribution
jake
parents:
diff changeset
     3
b856a9924bbc initial contribution
jake
parents:
diff changeset
     4
#include "publishercreator.h"
b856a9924bbc initial contribution
jake
parents:
diff changeset
     5
b856a9924bbc initial contribution
jake
parents:
diff changeset
     6
PublisherCreator::PublisherCreator(MainWindow& aUi) : iUi( aUi )
b856a9924bbc initial contribution
jake
parents:
diff changeset
     7
{
b856a9924bbc initial contribution
jake
parents:
diff changeset
     8
    copyFiles();
b856a9924bbc initial contribution
jake
parents:
diff changeset
     9
}
b856a9924bbc initial contribution
jake
parents:
diff changeset
    10
b856a9924bbc initial contribution
jake
parents:
diff changeset
    11
void PublisherCreator::copyFiles()
b856a9924bbc initial contribution
jake
parents:
diff changeset
    12
{
b856a9924bbc initial contribution
jake
parents:
diff changeset
    13
    QDir dir;
b856a9924bbc initial contribution
jake
parents:
diff changeset
    14
b856a9924bbc initial contribution
jake
parents:
diff changeset
    15
    // Copy publisher interface as is
b856a9924bbc initial contribution
jake
parents:
diff changeset
    16
    dir.mkpath( iUi.widgetName() + "/publisherif/inc");
b856a9924bbc initial contribution
jake
parents:
diff changeset
    17
    QFile::copy ( "data/publisherif/inc/hspublisher.h",
b856a9924bbc initial contribution
jake
parents:
diff changeset
    18
                  iUi.widgetName() + "/publisherif/inc/hspublisher.h");
b856a9924bbc initial contribution
jake
parents:
diff changeset
    19
    QFile::copy ( "data/publisherif/inc/hspublisherimpl.h",
b856a9924bbc initial contribution
jake
parents:
diff changeset
    20
                  iUi.widgetName() + "/publisherif/inc/hspublisherimpl.h");
b856a9924bbc initial contribution
jake
parents:
diff changeset
    21
    QFile::copy ( "data/publisherif/inc/hswidgetobserver.h",
b856a9924bbc initial contribution
jake
parents:
diff changeset
    22
                  iUi.widgetName() + "/publisherif/inc/hswidgetobserver.h");
b856a9924bbc initial contribution
jake
parents:
diff changeset
    23
    QFile::copy ( "data/publisherif/inc/transaction.h",
b856a9924bbc initial contribution
jake
parents:
diff changeset
    24
                  iUi.widgetName() + "/publisherif/inc/transaction.h");
b856a9924bbc initial contribution
jake
parents:
diff changeset
    25
b856a9924bbc initial contribution
jake
parents:
diff changeset
    26
b856a9924bbc initial contribution
jake
parents:
diff changeset
    27
    dir.mkpath( iUi.widgetName() + "/publisherif/src");
b856a9924bbc initial contribution
jake
parents:
diff changeset
    28
    QFile::copy ( "data/publisherif/src/hspublisher.cpp",
b856a9924bbc initial contribution
jake
parents:
diff changeset
    29
                  iUi.widgetName() + "/publisherif/src/hspublisher.cpp");
b856a9924bbc initial contribution
jake
parents:
diff changeset
    30
    QFile::copy ( "data/publisherif/src/hspublisherimpl.cpp",
b856a9924bbc initial contribution
jake
parents:
diff changeset
    31
                  iUi.widgetName() + "/publisherif/src/hspublisherimpl.cpp");
b856a9924bbc initial contribution
jake
parents:
diff changeset
    32
    QFile::copy ( "data/publisherif/src/transaction.cpp",
b856a9924bbc initial contribution
jake
parents:
diff changeset
    33
                  iUi.widgetName() + "/publisherif/src/transaction.cpp");
b856a9924bbc initial contribution
jake
parents:
diff changeset
    34
b856a9924bbc initial contribution
jake
parents:
diff changeset
    35
    // Copy test publisher
b856a9924bbc initial contribution
jake
parents:
diff changeset
    36
    dir.mkpath( iUi.widgetName() + "/testpublisher/data");
b856a9924bbc initial contribution
jake
parents:
diff changeset
    37
    QFile::copy ( "data/testpublisher/data/testpublisher.rls",
b856a9924bbc initial contribution
jake
parents:
diff changeset
    38
                  iUi.widgetName() + "/testpublisher/data/testpublisher.rls");
b856a9924bbc initial contribution
jake
parents:
diff changeset
    39
    QFile::copy ( "data/testpublisher/data/testpublisher.rss",
b856a9924bbc initial contribution
jake
parents:
diff changeset
    40
                  iUi.widgetName() + "/testpublisher/data/testpublisher.rss");
b856a9924bbc initial contribution
jake
parents:
diff changeset
    41
    QFile::copy ( "data/testpublisher/data/testpublisher_reg.rss",
b856a9924bbc initial contribution
jake
parents:
diff changeset
    42
                  iUi.widgetName() + "/testpublisher/data/testpublisher_reg.rss");
b856a9924bbc initial contribution
jake
parents:
diff changeset
    43
b856a9924bbc initial contribution
jake
parents:
diff changeset
    44
    dir.mkpath( iUi.widgetName() + "/testpublisher/gfx");
b856a9924bbc initial contribution
jake
parents:
diff changeset
    45
    QFile::copy ( "data/testpublisher/gfx/qgn_menu_TestPublisher.svg",
b856a9924bbc initial contribution
jake
parents:
diff changeset
    46
                  iUi.widgetName() + "/testpublisher/gfx/qgn_menu_TestPublisher.svg");
b856a9924bbc initial contribution
jake
parents:
diff changeset
    47
    QFile::copy ( "data/testpublisher/gfx/f1.png",
b856a9924bbc initial contribution
jake
parents:
diff changeset
    48
                  iUi.widgetName() + "/testpublisher/gfx/f1.png");
b856a9924bbc initial contribution
jake
parents:
diff changeset
    49
    QFile::copy ( "data/testpublisher/gfx/cricket.png",
b856a9924bbc initial contribution
jake
parents:
diff changeset
    50
                  iUi.widgetName() + "/testpublisher/gfx/cricket.png");
b856a9924bbc initial contribution
jake
parents:
diff changeset
    51
    QFile::copy ( "data/testpublisher/gfx/tennis.png",
b856a9924bbc initial contribution
jake
parents:
diff changeset
    52
                  iUi.widgetName() + "/testpublisher/gfx/tennis.png");
2
0c23d71853fe added copying of two png images into publishercreator.cpp
jake
parents: 0
diff changeset
    53
    QFile::copy ( "data/testpublisher/gfx/rss.png",
0c23d71853fe added copying of two png images into publishercreator.cpp
jake
parents: 0
diff changeset
    54
                  iUi.widgetName() + "/testpublisher/gfx/rss.png");
0c23d71853fe added copying of two png images into publishercreator.cpp
jake
parents: 0
diff changeset
    55
    QFile::copy ( "data/testpublisher/gfx/rss_small.png",
0c23d71853fe added copying of two png images into publishercreator.cpp
jake
parents: 0
diff changeset
    56
                  iUi.widgetName() + "/testpublisher/gfx/rss_small.png");
0
b856a9924bbc initial contribution
jake
parents:
diff changeset
    57
b856a9924bbc initial contribution
jake
parents:
diff changeset
    58
    dir.mkpath( iUi.widgetName() + "/testpublisher/group");
b856a9924bbc initial contribution
jake
parents:
diff changeset
    59
    QFile::copy ( "data/testpublisher/group/bld.inf",
b856a9924bbc initial contribution
jake
parents:
diff changeset
    60
                  iUi.widgetName() + "/testpublisher/group/bld.inf");
b856a9924bbc initial contribution
jake
parents:
diff changeset
    61
    QFile::copy ( "data/testpublisher/group/icons_scalable_dc.mk",
b856a9924bbc initial contribution
jake
parents:
diff changeset
    62
                  iUi.widgetName() + "/testpublisher/group/icons_scalable_dc.mk");
b856a9924bbc initial contribution
jake
parents:
diff changeset
    63
    QFile::copy ( "data/testpublisher/group/testpublisher.mmp",
b856a9924bbc initial contribution
jake
parents:
diff changeset
    64
                  iUi.widgetName() + "/testpublisher/group/testpublisher.mmp");
b856a9924bbc initial contribution
jake
parents:
diff changeset
    65
b856a9924bbc initial contribution
jake
parents:
diff changeset
    66
    dir.mkpath( iUi.widgetName() + "/testpublisher/inc");
b856a9924bbc initial contribution
jake
parents:
diff changeset
    67
    QFile::copy ( "data/testpublisher/inc/testpublisher.hrh",
b856a9924bbc initial contribution
jake
parents:
diff changeset
    68
                  iUi.widgetName() + "/testpublisher/inc/testpublisher.hrh");
b856a9924bbc initial contribution
jake
parents:
diff changeset
    69
    QFile::copy ( "data/testpublisher/inc/testpublisher.pan",
b856a9924bbc initial contribution
jake
parents:
diff changeset
    70
                  iUi.widgetName() + "/testpublisher/inc/testpublisher.pan");
b856a9924bbc initial contribution
jake
parents:
diff changeset
    71
    QFile::copy ( "data/testpublisher/inc/testpublisherapplication.h",
b856a9924bbc initial contribution
jake
parents:
diff changeset
    72
                  iUi.widgetName() + "/testpublisher/inc/testpublisherapplication.h");
b856a9924bbc initial contribution
jake
parents:
diff changeset
    73
    QFile::copy ( "data/testpublisher/inc/testpublisherappui.h",
b856a9924bbc initial contribution
jake
parents:
diff changeset
    74
                  iUi.widgetName() + "/testpublisher/inc/testpublisherappui.h");
b856a9924bbc initial contribution
jake
parents:
diff changeset
    75
    QFile::copy ( "data/testpublisher/inc/testpublisherappview.h",
b856a9924bbc initial contribution
jake
parents:
diff changeset
    76
                  iUi.widgetName() + "/testpublisher/inc/testpublisherappview.h");
b856a9924bbc initial contribution
jake
parents:
diff changeset
    77
    QFile::copy ( "data/testpublisher/inc/testpublisherdocument.h",
b856a9924bbc initial contribution
jake
parents:
diff changeset
    78
                  iUi.widgetName() + "/testpublisher/inc/testpublisherdocument.h");
b856a9924bbc initial contribution
jake
parents:
diff changeset
    79
b856a9924bbc initial contribution
jake
parents:
diff changeset
    80
    dir.mkpath( iUi.widgetName() + "/testpublisher/sis");
b856a9924bbc initial contribution
jake
parents:
diff changeset
    81
    QFile::copy ( "data/testpublisher/sis/backup_registration.xml",
b856a9924bbc initial contribution
jake
parents:
diff changeset
    82
                  iUi.widgetName() + "/testpublisher/sis/backup_registration.xml");
4
63928ff6db8d Added the setting file, which enables the automatic launch of the publisher. Fixed the issues with the .pkg files.
jake
parents: 2
diff changeset
    83
    QFile::copy ( "data/testpublisher/sis/TestPublisher.pkg",
63928ff6db8d Added the setting file, which enables the automatic launch of the publisher. Fixed the issues with the .pkg files.
jake
parents: 2
diff changeset
    84
                  iUi.widgetName() + "/testpublisher/sis/TestPublisher.pkg");
0
b856a9924bbc initial contribution
jake
parents:
diff changeset
    85
b856a9924bbc initial contribution
jake
parents:
diff changeset
    86
    dir.mkpath( iUi.widgetName() + "/testpublisher/src");
b856a9924bbc initial contribution
jake
parents:
diff changeset
    87
    QFile::copy ( "data/testpublisher/src/testpublisher.cpp",
b856a9924bbc initial contribution
jake
parents:
diff changeset
    88
                  iUi.widgetName() + "/testpublisher/src/testpublisher.cpp");
b856a9924bbc initial contribution
jake
parents:
diff changeset
    89
    QFile::copy ( "data/testpublisher/src/testpublisherapplication.cpp",
b856a9924bbc initial contribution
jake
parents:
diff changeset
    90
                  iUi.widgetName() + "/testpublisher/src/testpublisherapplication.cpp");
b856a9924bbc initial contribution
jake
parents:
diff changeset
    91
    QFile::copy ( "data/testpublisher/src/testpublisherappui.cpp",
b856a9924bbc initial contribution
jake
parents:
diff changeset
    92
                  iUi.widgetName() + "/testpublisher/src/testpublisherappui.cpp");
b856a9924bbc initial contribution
jake
parents:
diff changeset
    93
    //QFile::copy ( "data/testpublisher/src/testpublisherappview.cpp",
b856a9924bbc initial contribution
jake
parents:
diff changeset
    94
    //              iUi.widgetName() + "/testpublisher/src/testpublisherappview.cpp");
b856a9924bbc initial contribution
jake
parents:
diff changeset
    95
    QFile::copy ( "data/testpublisher/src/testpublisherdocument.cpp",
b856a9924bbc initial contribution
jake
parents:
diff changeset
    96
                  iUi.widgetName() + "/testpublisher/src/testpublisherdocument.cpp");
b856a9924bbc initial contribution
jake
parents:
diff changeset
    97
b856a9924bbc initial contribution
jake
parents:
diff changeset
    98
    iUi.replaceData("data/testpublisher/src/testpublisherappview.cpp",
b856a9924bbc initial contribution
jake
parents:
diff changeset
    99
                iUi.widgetName() + "/testpublisher/src/testpublisherappview.cpp" );
b856a9924bbc initial contribution
jake
parents:
diff changeset
   100
4
63928ff6db8d Added the setting file, which enables the automatic launch of the publisher. Fixed the issues with the .pkg files.
jake
parents: 2
diff changeset
   101
    iUi.replaceData("data/testpublisher/data/testpublisher_0xe5555555_fs.xml",
63928ff6db8d Added the setting file, which enables the automatic launch of the publisher. Fixed the issues with the .pkg files.
jake
parents: 2
diff changeset
   102
                iUi.widgetName() + "/testpublisher/data/testpublisher_0xe5555555_fs.xml");
63928ff6db8d Added the setting file, which enables the automatic launch of the publisher. Fixed the issues with the .pkg files.
jake
parents: 2
diff changeset
   103
0
b856a9924bbc initial contribution
jake
parents:
diff changeset
   104
}