This file is indexed.

/usr/include/libtomahawk/GlobalActionManager.h is in libtomahawk-dev 0.8.4+dfsg1-0ubuntu1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
/*
    Copyright (C) 2011  Leo Franchi <lfranchi@kde.org>

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License along
    with this program; if not, write to the Free Software Foundation, Inc.,
    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/


#ifndef GLOBALACTIONMANAGER_H
#define GLOBALACTIONMANAGER_H

#include "Playlist.h"
#include "playlist/dynamic/DynamicPlaylist.h"
#include "DllMacro.h"

#include <QNetworkAccessManager>
#include <QNetworkReply>
#include <QObject>
#include <QUrl>

/**
 * Handles global actions such as parsing and creation of links, mime data handling, etc
 */
class DLLEXPORT GlobalActionManager : public QObject
{
    Q_OBJECT
public:
    static GlobalActionManager* instance();
    virtual ~GlobalActionManager();

    QUrl openLinkFromQuery( const Tomahawk::query_ptr& query ) const;

    QUrl copyOpenLink( const Tomahawk::artist_ptr& artist ) const;
    QUrl copyOpenLink( const Tomahawk::album_ptr& album ) const;

    QUrl openLink( const QString& title, const QString& artist, const QString& album ) const;

    void installResolverFromFile( const QString& resolverPath );

public slots:

    /**
     * Try to open a URL as Playlist/Album/Artist/Track
     */
    bool openUrl( const QString& url );

    /// Takes a spotify link and performs the default open action on it
    bool openSpotifyLink( const QString& link );

    /// Creates a link from the requested data and copies it to the clipboard
    void copyToClipboard( const Tomahawk::query_ptr& query );


    QString copyPlaylistToClipboard( const Tomahawk::dynplaylist_ptr& playlist );
    void savePlaylistToFile( const Tomahawk::playlist_ptr& playlist, const QString& filename );

    bool parseTomahawkLink( const QString& link );
    void waitingForResolved( bool );

    Tomahawk::dynplaylist_ptr loadDynamicPlaylist( const QUrl& url, bool station );

    void handleOpenTrack( const Tomahawk::query_ptr& qry );
    void handleOpenTracks( const QList< Tomahawk::query_ptr >& queries );

    void handlePlayTrack( const Tomahawk::query_ptr& qry );

private slots:
    void informationForUrl( const QString& url, const QSharedPointer<QObject>& information );
    void copyToClipboardReady( const QUrl& longUrl, const QUrl& shortUrl, const QVariant& callbackObj );

    void showPlaylist();

    void playlistCreatedToShow( const Tomahawk::playlist_ptr& pl );
    void playlistReadyToShow();

    void xspfCreated( const QByteArray& xspf );

    void playOrQueueNow( const Tomahawk::query_ptr& );
    void playNow( const Tomahawk::query_ptr& );

private:
    explicit GlobalActionManager( QObject* parent = 0 );

    /// handle opening of urls
    bool handlePlaylistCommand( const QUrl& url );
    bool handleViewCommand( const QUrl& url );
    bool handleStationCommand( const QUrl& url );
    bool handleSearchCommand( const QUrl& url );
    bool handleQueueCommand( const QUrl& url );
    bool handleAutoPlaylistCommand( const QUrl& url );
    bool handleImportCommand( const QUrl& url );
    bool doQueueAdd( const QStringList& parts, const QList< QPair< QString, QString > >& queryItems );

    bool playSpotify( const QUrl& url );
    bool queueSpotify( const QStringList& parts, const QList< QPair< QString, QString > >& queryItems );

    bool handleCollectionCommand( const QUrl& url );
    bool handlePlayCommand( const QUrl& url );
    bool handleOpenCommand( const QUrl& url );
    bool handleLoveCommand( const QUrl& url );

    void createPlaylistFromUrl( const QString& type, const QString& url, const QString& title );

    QString hostname() const;

    Tomahawk::playlist_ptr m_toShow;
    Tomahawk::query_ptr m_waitingToPlay;
    QUrl m_clipboardLongUrl;
    QString m_queuedUrl;

    static GlobalActionManager* s_instance;
};

#endif // GLOBALACTIONMANAGER_H