publishercreator.cpp
changeset 0 b856a9924bbc
child 2 0c23d71853fe
equal deleted inserted replaced
-1:000000000000 0:b856a9924bbc
       
     1 #include <QFile>
       
     2 #include <QDir>
       
     3 
       
     4 #include "publishercreator.h"
       
     5 
       
     6 PublisherCreator::PublisherCreator(MainWindow& aUi) : iUi( aUi )
       
     7 {
       
     8     copyFiles();
       
     9 }
       
    10 
       
    11 void PublisherCreator::copyFiles()
       
    12 {
       
    13     QDir dir;
       
    14 
       
    15     // Copy publisher interface as is
       
    16     dir.mkpath( iUi.widgetName() + "/publisherif/inc");
       
    17     QFile::copy ( "data/publisherif/inc/hspublisher.h",
       
    18                   iUi.widgetName() + "/publisherif/inc/hspublisher.h");
       
    19     QFile::copy ( "data/publisherif/inc/hspublisherimpl.h",
       
    20                   iUi.widgetName() + "/publisherif/inc/hspublisherimpl.h");
       
    21     QFile::copy ( "data/publisherif/inc/hswidgetobserver.h",
       
    22                   iUi.widgetName() + "/publisherif/inc/hswidgetobserver.h");
       
    23     QFile::copy ( "data/publisherif/inc/transaction.h",
       
    24                   iUi.widgetName() + "/publisherif/inc/transaction.h");
       
    25 
       
    26 
       
    27     dir.mkpath( iUi.widgetName() + "/publisherif/src");
       
    28     QFile::copy ( "data/publisherif/src/hspublisher.cpp",
       
    29                   iUi.widgetName() + "/publisherif/src/hspublisher.cpp");
       
    30     QFile::copy ( "data/publisherif/src/hspublisherimpl.cpp",
       
    31                   iUi.widgetName() + "/publisherif/src/hspublisherimpl.cpp");
       
    32     QFile::copy ( "data/publisherif/src/transaction.cpp",
       
    33                   iUi.widgetName() + "/publisherif/src/transaction.cpp");
       
    34 
       
    35     // Copy test publisher
       
    36     dir.mkpath( iUi.widgetName() + "/testpublisher/data");
       
    37     QFile::copy ( "data/testpublisher/data/testpublisher.rls",
       
    38                   iUi.widgetName() + "/testpublisher/data/testpublisher.rls");
       
    39     QFile::copy ( "data/testpublisher/data/testpublisher.rss",
       
    40                   iUi.widgetName() + "/testpublisher/data/testpublisher.rss");
       
    41     QFile::copy ( "data/testpublisher/data/testpublisher_reg.rss",
       
    42                   iUi.widgetName() + "/testpublisher/data/testpublisher_reg.rss");
       
    43 
       
    44     dir.mkpath( iUi.widgetName() + "/testpublisher/gfx");
       
    45     QFile::copy ( "data/testpublisher/gfx/qgn_menu_TestPublisher.svg",
       
    46                   iUi.widgetName() + "/testpublisher/gfx/qgn_menu_TestPublisher.svg");
       
    47     QFile::copy ( "data/testpublisher/gfx/f1.png",
       
    48                   iUi.widgetName() + "/testpublisher/gfx/f1.png");
       
    49     QFile::copy ( "data/testpublisher/gfx/cricket.png",
       
    50                   iUi.widgetName() + "/testpublisher/gfx/cricket.png");
       
    51     QFile::copy ( "data/testpublisher/gfx/tennis.png",
       
    52                   iUi.widgetName() + "/testpublisher/gfx/tennis.png");
       
    53 
       
    54     dir.mkpath( iUi.widgetName() + "/testpublisher/group");
       
    55     QFile::copy ( "data/testpublisher/group/bld.inf",
       
    56                   iUi.widgetName() + "/testpublisher/group/bld.inf");
       
    57     QFile::copy ( "data/testpublisher/group/icons_scalable_dc.mk",
       
    58                   iUi.widgetName() + "/testpublisher/group/icons_scalable_dc.mk");
       
    59     QFile::copy ( "data/testpublisher/group/testpublisher.mmp",
       
    60                   iUi.widgetName() + "/testpublisher/group/testpublisher.mmp");
       
    61 
       
    62     dir.mkpath( iUi.widgetName() + "/testpublisher/inc");
       
    63     QFile::copy ( "data/testpublisher/inc/testpublisher.hrh",
       
    64                   iUi.widgetName() + "/testpublisher/inc/testpublisher.hrh");
       
    65     QFile::copy ( "data/testpublisher/inc/testpublisher.pan",
       
    66                   iUi.widgetName() + "/testpublisher/inc/testpublisher.pan");
       
    67     QFile::copy ( "data/testpublisher/inc/testpublisherapplication.h",
       
    68                   iUi.widgetName() + "/testpublisher/inc/testpublisherapplication.h");
       
    69     QFile::copy ( "data/testpublisher/inc/testpublisherappui.h",
       
    70                   iUi.widgetName() + "/testpublisher/inc/testpublisherappui.h");
       
    71     QFile::copy ( "data/testpublisher/inc/testpublisherappview.h",
       
    72                   iUi.widgetName() + "/testpublisher/inc/testpublisherappview.h");
       
    73     QFile::copy ( "data/testpublisher/inc/testpublisherdocument.h",
       
    74                   iUi.widgetName() + "/testpublisher/inc/testpublisherdocument.h");
       
    75 
       
    76     dir.mkpath( iUi.widgetName() + "/testpublisher/sis");
       
    77     QFile::copy ( "data/testpublisher/sis/backup_registration.xml",
       
    78                   iUi.widgetName() + "/testpublisher/sis/backup_registration.xml");
       
    79     QFile::copy ( "data/testpublisher/sis/TestPublisher_S60_3_X_v_1_0_0.pkg",
       
    80                   iUi.widgetName() + "/testpublisher/sis/TestPublisher_S60_3_X_v_1_0_0.pkg");
       
    81 
       
    82     dir.mkpath( iUi.widgetName() + "/testpublisher/src");
       
    83     QFile::copy ( "data/testpublisher/src/testpublisher.cpp",
       
    84                   iUi.widgetName() + "/testpublisher/src/testpublisher.cpp");
       
    85     QFile::copy ( "data/testpublisher/src/testpublisherapplication.cpp",
       
    86                   iUi.widgetName() + "/testpublisher/src/testpublisherapplication.cpp");
       
    87     QFile::copy ( "data/testpublisher/src/testpublisherappui.cpp",
       
    88                   iUi.widgetName() + "/testpublisher/src/testpublisherappui.cpp");
       
    89     //QFile::copy ( "data/testpublisher/src/testpublisherappview.cpp",
       
    90     //              iUi.widgetName() + "/testpublisher/src/testpublisherappview.cpp");
       
    91     QFile::copy ( "data/testpublisher/src/testpublisherdocument.cpp",
       
    92                   iUi.widgetName() + "/testpublisher/src/testpublisherdocument.cpp");
       
    93 
       
    94     iUi.replaceData("data/testpublisher/src/testpublisherappview.cpp",
       
    95                 iUi.widgetName() + "/testpublisher/src/testpublisherappview.cpp" );
       
    96 
       
    97 }