Ejemplo n.º 1
0
QContent *WheelBrowserScreen::readLauncherMenuItem(const QString &entry)
{
    QContent *applnk = 0;

    if (entry.right(8)==".desktop") {
        // There used to be a quick way to locate a .desktop file
        // Now we have to create a QContentSet and iterate over the items

        // The path to the apps folder (which only exists in the database)
        QString apps = Qtopia::qtopiaDir()+"apps/";
        // We need the full path to the entry to compare against the items we get from QContentSet
        QString entryPath = apps+entry;
        applnk = new QContent( entryPath, false );
        if ( applnk->id() == QContent::InvalidId ) {
            delete applnk;
            applnk = 0;
        }
    } else {
        QCategoryManager catman("Applications");
        if(catman.contains(entry))
        {
            applnk = new QContent();
            applnk->setName(catman.label(entry));
            applnk->setIcon(catman.iconFile(entry));
            applnk->setType("Folder/"+entry);
        }
        else
            applnk = NULL;
    }

    return applnk;
}
Ejemplo n.º 2
0
/*!
  Given an application binary name \a bin return the QContentId of the QContent record
  for that application.  If \a bin is the fully qualified path of an ordinary file the
  QContentId of that file will be returned.

  If \a bin does not refer to any application or file in the backing store then an
  InvalidId will be returned.

  Note that binary names are unique across Qtopia.
 */
QContentId QContent::execToContent( const QString& bin )
{
    QContent content = QContentStore::instance()->contentFromFileName( bin, QContentStore::Lookup );

    if( !content.isNull() )
        return content.id();
    else
        return QContent::InvalidId;
}
Ejemplo n.º 3
0
/*!
  Returns the name of the name of the application that will be launched if the QContent is executed.

  If the QContent is an application this is the name of the binary, if it is a document it is the
  executable name of the application associated with the document MIME type.

  If the content is not an application and there is no associated application associated with its
  MIME type then a null string will be returned.

  \sa execute()
 */
QString QContent::executableName() const
{
    if( role() == Application )
    {
        return d->fileName();
    }
    else
    {
        QContent app = d->mimeType().application();
        if ( app.id() != InvalidId )
            return app.executableName();
        else
            return QString();
    }
}
Ejemplo n.º 4
0
/*!
    \reimp
*/
void BSciContentLicense::renderStateChanged( const QContent &content, QDrmContent::RenderState state )
{
    if( content.id() != m_content.id() )
        return;

    switch( state )
    {
    case QDrmContent::Started:
        startConstraintUpdates();
        break;
    case QDrmContent::Paused:
        pauseConstraintUpdates();
        break;
    case QDrmContent::Stopped:
        stopConstraintUpdates();
    }
}
Ejemplo n.º 5
0
void CameraMainWindow::loadThumbs( bool resized )
{
    int i = 0;
    showWaitScreen();
    for (; i < nthumb && i < m_photoModel->rowCount(); ++i)
    {
        QContent content = m_photoModel->content(i);
        if (resized || picturefile[i].id() != content.id() || picturefile[i].lastUpdated() != content.lastUpdated()) {
            picturefile[i] = content;

            thumb[i]->setIcon(QThumbnail(picturefile[i].fileName()).pixmap(QSize(thumbw, thumbh)));
            thumb[i]->setEnabled(true);
        }
    }

    for (; i < nthumb; ++i) {
        picturefile[i] = QContent();
        thumb[i]->setIcon(QIcon());
        thumb[i]->setEnabled(false);
    }

    if ( cur_thumb >= 0 )
        selectThumb(cur_thumb);

    if ( !camera->videocaptureview->available() ) {
        if(settings)
            a_timer->setVisible(false);
        camera->photo->setEnabled(false);
        camera->video->setEnabled(false);
        if (m_photoModel->rowCount() == 0) {
            thumb[0]->setEnabled(false);
        } else {
            thumb[0]->setFocus();
            thumb[0]->setEnabled(true);
        }
    }

    if(settings)
        updateActions();
    hideWaitScreen();
}
Ejemplo n.º 6
0
/*!
    \reimp
*/
void BSciPreviewLicense::renderStateChanged( const QContent &content, QDrmContent::RenderState state )
{
    if( content.id() == m_content.id() )
        m_renderState = state;
}