~ubuntu-branches/ubuntu/wily/unity-webapps-qml/wily-proposed

« back to all changes in this revision

Viewing changes to src/Ubuntu/UnityWebApps/plugin/unity-webapps-app-model.cpp

  • Committer: Package Import Robot
  • Author(s): Ubuntu daily release, Ken VanDine, Alexandre Abreu
  • Date: 2014-06-26 01:48:37 UTC
  • mfrom: (1.1.33)
  • Revision ID: package-import@ubuntu.com-20140626014837-kdt1gvd2vnxfcrqx
Tags: 0.1+14.10.20140626.1-0ubuntu1
[ Ken VanDine ]
* add content share

[ Alexandre Abreu ]
* add content share

Show diffs side-by-side

added added

removed removed

Lines of Context:
156
156
        roles[Scripts] = "scripts";
157
157
        roles[Chrome] = "chrome";
158
158
        roles[UserAgentOverride] = "useragent";
 
159
        roles[Path] = "path";
159
160
      }
160
161
    return roles;
161
162
}
337
338
}
338
339
 
339
340
QString
 
341
UnityWebappsAppModel::path(const QString & webappName) const {
 
342
    if (!exists(webappName))
 
343
        return QString();
 
344
 
 
345
    int idx = getWebappIndex(webappName);
 
346
    if (Q_UNLIKELY(idx == -1))
 
347
    {
 
348
        qDebug() << "Invalid index for a supposedly existing webapp: " << webappName;
 
349
        return QString();
 
350
    }
 
351
 
 
352
    return data(idx, Path).toString();
 
353
}
 
354
 
 
355
QString
340
356
UnityWebappsAppModel::userAgentOverrideFor(const QString & webappName) const
341
357
{
342
358
    if (!exists(webappName))
543
559
 
544
560
    case UserAgentOverride:
545
561
        return webapp.data.manifest.userAgentOverride;
 
562
 
 
563
    case Path:
 
564
        return webapp.userscriptLocation;
546
565
    }
547
566
 
548
567
    return QVariant();