src/hbservers/hbsplashgenerator/hbsplashgen_server_symbian.cpp
changeset 2 06ff229162e9
parent 1 f7ac710697a9
child 3 11d3954df52a
equal deleted inserted replaced
1:f7ac710697a9 2:06ff229162e9
    62     ~HbSplashGenServerSymbian();
    62     ~HbSplashGenServerSymbian();
    63     CSession2 *NewSessionL(const TVersion &version, const RMessage2 &message) const;
    63     CSession2 *NewSessionL(const TVersion &version, const RMessage2 &message) const;
    64 
    64 
    65     void setSplashScreenDir(const QString &dir) { mSplashScreenDir = dir; }
    65     void setSplashScreenDir(const QString &dir) { mSplashScreenDir = dir; }
    66     void setSplashScreenDirContents(const QStringList &entries) { mSplashScreenDirEntries = entries; }
    66     void setSplashScreenDirContents(const QStringList &entries) { mSplashScreenDirEntries = entries; }
       
    67     bool startupSuccess() const { return mStartupSuccess; }
    67 
    68 
    68     bool processGetSplash(const RMessage2 &message);
    69     bool processGetSplash(const RMessage2 &message);
    69 
    70 
    70 private:
    71 private:
    71     bool transferHandle(const RMessage2 &message, const QString &fileName);
    72     bool transferHandle(const RMessage2 &message, const QString &fileName);
    72 
    73 
       
    74     bool mStartupSuccess;
    73     RFs mFs;
    75     RFs mFs;
    74     QString mSplashScreenDir;
    76     QString mSplashScreenDir;
    75     QStringList mSplashScreenDirEntries;
    77     QStringList mSplashScreenDirEntries;
    76 };
    78 };
    77 
    79 
   104     qDebug() << PRE << entries;
   106     qDebug() << PRE << entries;
   105     mServer->setSplashScreenDir(dir);
   107     mServer->setSplashScreenDir(dir);
   106     mServer->setSplashScreenDirContents(entries);
   108     mServer->setSplashScreenDirContents(entries);
   107 }
   109 }
   108 
   110 
       
   111 bool HbSplashGenServer::startupSuccess() const
       
   112 {
       
   113     return mServer->startupSuccess();
       
   114 }
       
   115 
   109 HbSplashGenServerSymbian::HbSplashGenServerSymbian()
   116 HbSplashGenServerSymbian::HbSplashGenServerSymbian()
   110     : CServer2(CActive::EPriorityHigh)
   117     : CServer2(CActive::EPriorityHigh)
   111 {
   118 {
   112     if (mFs.Connect() == KErrNone) {
   119     TInt err = mFs.Connect();
       
   120     if (err == KErrNone) {
   113         mFs.ShareProtected();
   121         mFs.ShareProtected();
       
   122         TRAP(err, StartL(hbsplash_server_name));
       
   123         if (err == KErrNone) {
       
   124             qDebug() << PRE << "server started";
       
   125         } else {
       
   126             qWarning() << PRE << "server start failed" << err;
       
   127         }
   114     } else {
   128     } else {
   115         qWarning() << PRE << "cannot connect to file server";
   129         qWarning() << PRE << "cannot connect to file server";
   116     }
   130     }
   117     TRAPD(err, StartL(hbsplash_server_name));
   131     mStartupSuccess = (err == KErrNone);
   118     if (err == KErrNone) {
       
   119         qDebug() << PRE << "server started";
       
   120     } else {
       
   121         qWarning() << PRE << "server start failed" << err;
       
   122     }
       
   123     // Now it is the right time to do the rendezvous. By default it would be
   132     // Now it is the right time to do the rendezvous. By default it would be
   124     // done too early so the custom appui disables FrameworkCallsRendezvous and
   133     // done too early so the custom appui disables FrameworkCallsRendezvous and
   125     // it is done here instead.
   134     // it is done here instead.
   126     RProcess::Rendezvous(KErrNone);
   135     RProcess::Rendezvous(err);
   127 }
   136 }
   128 
   137 
   129 HbSplashGenServerSymbian::~HbSplashGenServerSymbian()
   138 HbSplashGenServerSymbian::~HbSplashGenServerSymbian()
   130 {
   139 {
   131     mFs.Close();
   140     mFs.Close();