コード例 #1
0
void ProjectItem::removeItem( const ProjectItem& item )
{
	//auto it = std::find(items.begin(), items.end(), item);
	//
	//if( it != items.end() )
	//	items.erase(it);

	onItemRemoved(item);
}
コード例 #2
0
ファイル: kstandarditemmodel.cpp プロジェクト: KDE/dolphin
void KStandardItemModel::removeItem(int index)
{
    if (index >= 0 && index < count()) {
        KStandardItem* item = m_items[index];
        m_indexesForItems.remove(item);
        m_items.removeAt(index);

        // Removing an item requires to update the indexes
        // afterwards from m_indexesForItems.
        for (int i = index; i < m_items.count(); ++i) {
            m_indexesForItems.insert(m_items[i], i);
        }

        onItemRemoved(index, item);

        delete item;
        item = 0;

        emit itemsRemoved(KItemRangeList() << KItemRange(index, 1));

        // TODO: no hierarchical items are handled yet
    }
}
コード例 #3
0
int MoodBox::DrawingWindow::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QWidget::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: clipartWindowRequest(); break;
        case 1: messageSent(); break;
        case 2: replyChanged(); break;
        case 3: clear(); break;
        case 4: reset(); break;
        case 5: addImage((*reinterpret_cast< const QImage(*)>(_a[1]))); break;
        case 6: addReply((*reinterpret_cast< const QImage(*)>(_a[1]))); break;
        case 7: on_penToolButton_clicked(); break;
        case 8: on_simplebrushToolButton_clicked(); break;
        case 9: on_oilbrushToolButton_clicked(); break;
        case 10: on_sprayToolButton_clicked(); break;
        case 11: on_eraserToolButton_clicked(); break;
        case 12: on_textToolButton_clicked(); break;
        case 13: on_picturesToolButton_clicked(); break;
        case 14: on_sendButton_clicked(); break;
        case 15: onItemAdded((*reinterpret_cast< QGraphicsItem*(*)>(_a[1]))); break;
        case 16: onItemRemoved((*reinterpret_cast< QGraphicsItem*(*)>(_a[1]))); break;
        case 17: onSceneCleared(); break;
        case 18: onSaveScene(); break;
        case 19: onSceneColorChanged(); break;
        case 20: onUndoChanged(); break;
        case 21: onContactListChanged(); break;
        case 22: onContactAuthorizationChanged((*reinterpret_cast< qint32(*)>(_a[1]))); break;
        case 23: onUserOnlineChanged(); break;
        default: ;
        }
        _id -= 24;
    }
    return _id;
}
コード例 #4
0
ファイル: awnservice.cpp プロジェクト: AlexeyProkhin/qutim
AWNService::AWNService()
{
    m_uread = 0;
    m_item = 0;
    m_activeAccount = 0;
    m_iconTimer = 0;
	//m_cws = 0;
    m_awn = new QDBusInterface("net.launchpad.DockManager",
                              "/net/launchpad/DockManager",
                              "net.launchpad.DockManager");
    QDBusConnection::sessionBus().connect("net.launchpad.DockManager",
                                          "/net/launchpad/DockManager",
                                          "net.launchpad.DockManager",
                                          "ItemRemoved",
                                          this,
                                          SLOT(onItemRemoved(QDBusObjectPath)));
    QDBusMessage mes = m_awn->call("GetCapabilities");
	if(mes.type()==QDBusMessage::ReplyMessage) {
        QDBusReply<QStringList> r;
        r = mes;
        m_capabilities = r.value();
		debug() << "[AWN] dock capabilities: " << m_capabilities;
    }
	else {
		debug() << "[AWN] error: " << mes.errorName() << " : " << mes.errorMessage();
        return;
    }
    if(! m_capabilities.contains("dock-item-icon-file")  ||
       ! m_capabilities.contains("dock-item-message")    ||
       ! m_capabilities.contains("menu-item-with-label") ||
       ! m_capabilities.contains("menu-item-icon-name")    )
    {
        deleteLater();
        return;
    }
    m_icon_size = 128;
    //TODO: а если несколько панелей, как определить на какой находится док?
    QDBusInterface panel("org.awnproject.Awn",
                         "/org/awnproject/Awn/Panel1",
                         "org.awnproject.Awn.Panel");
    QVariant var = panel.property("Size");
    if(var.isValid())
        m_icon_size = var.toInt();
    if(!QDir::temp().exists("qutim-awn"))
        QDir::temp().mkdir("qutim-awn");
    generateIcons();
    m_firstIcon = "qutim";
    m_currentIcon = "qutim";
    m_iconTimer = new QTimer(this);
    connect(m_iconTimer,SIGNAL(timeout()),this,SLOT(nextIcon()));
    m_iconTimer->start(500);
    m_cwc = new ChatWindowController(this);
    qApp->installEventFilter(this);
    connect(ChatLayer::instance(), SIGNAL(sessionCreated(qutim_sdk_0_3::ChatSession*)),this, SLOT(onSessionCreated(qutim_sdk_0_3::ChatSession*)));
    QMap<QString, Protocol*> protocols;
    foreach (Protocol *proto, Protocol::all()) {
        protocols.insert(proto->id(), proto);
        connect(proto, SIGNAL(accountCreated(qutim_sdk_0_3::Account*)),
                this, SLOT(onAccountCreated(qutim_sdk_0_3::Account*)));
        foreach(Account *a, proto->accounts())
            emit onAccountCreated(a);
    }
コード例 #5
0
ファイル: dirmodel.cpp プロジェクト: akashgaurav89/files-app
DirModel::DirModel(QObject *parent)
    : DirItemAbstractListModel(parent)
    , mFilterDirectories(false)
    , mShowDirectories(true)
    , mAwaitingResults(false)
    , mIsRecursive(false)
    , mReadsMediaMetadata(false)
    , mShowHiddenFiles(false)
    , mOnlyAllowedPaths(false)
    , mSortBy(SortByName)
    , mSortOrder(SortAscending)
    , mCompareFunction(0)
    , mExtFSWatcher(false)
    , mClipboard(new Clipboard(this))
    , mLocationFactory(new LocationsFactory(this))
    , mCurLocation(0)
    , m_fsAction(new FileSystemAction(this) )
{
    mNameFilters = QStringList() << "*";

    mSelection   =  new DirSelection(this, &mDirectoryContents);

    connect(m_fsAction, SIGNAL(progress(int,int,int)),
            this,     SIGNAL(progress(int,int,int)));

    connect(m_fsAction, SIGNAL(added(DirItemInfo)),
            this,     SLOT(onItemAdded(DirItemInfo)));

    connect(m_fsAction, SIGNAL(added(QString)),
            this,     SLOT(onItemAdded(QString)));

    connect(m_fsAction, SIGNAL(removed(DirItemInfo)),
            this,     SLOT(onItemRemoved(DirItemInfo)));

    connect(m_fsAction, SIGNAL(removed(QString)),
            this,     SLOT(onItemRemoved(QString)));

    connect(m_fsAction, SIGNAL(error(QString,QString)),
            this,     SIGNAL(error(QString,QString)));

    connect(this,     SIGNAL(pathChanged(QString)),
            m_fsAction, SLOT(pathChanged(QString)));

    connect(mClipboard, SIGNAL(clipboardChanged()),
            this,       SIGNAL(clipboardChanged()));

    connect(m_fsAction,  SIGNAL(changed(DirItemInfo)),
           this,        SLOT(onItemChanged(DirItemInfo)));

    connect(mClipboard, SIGNAL(clipboardChanged()),
            m_fsAction, SLOT(onClipboardChanged()));

    connect(m_fsAction, SIGNAL(recopy(QStringList,QString)),
            mClipboard, SLOT(copy(QStringList,QString)));

    setCompareAndReorder();

    if (QIcon::themeName().isEmpty() && !FMUtil::hasTriedThemeName())
    {
        FMUtil::setThemeName();
    }

    foreach (const Location* l, mLocationFactory->availableLocations())
    {
       connect(l,     SIGNAL(itemsAdded(DirItemInfoList)),
               this,  SLOT(onItemsAdded(DirItemInfoList)));

       connect(l,     SIGNAL(itemsFetched()),
               this,  SLOT(onItemsFetched()));

       connect(l,     SIGNAL(extWatcherItemAdded(DirItemInfo)),
               this,  SLOT(onItemAddedOutsideFm(DirItemInfo)));

       connect(l,     SIGNAL(extWatcherItemRemoved(DirItemInfo)),
               this,  SLOT(onItemRemovedOutSideFm(DirItemInfo)));

       connect(l,     SIGNAL(extWatcherItemChanged(DirItemInfo)),
               this,  SLOT(onItemChangedOutSideFm(DirItemInfo)));

       connect(l,     SIGNAL(extWatcherChangesFetched(int)),
               this,  SLOT(onExternalFsWorkerFinished(int)));

       connect(l,     SIGNAL(extWatcherPathChanged(QString)),
               this,  SLOT(onThereAreExternalChanges(QString)));

       connect(this,  SIGNAL(enabledExternalFSWatcherChanged(bool)),
               l,     SLOT(setUsingExternalWatcher(bool)));
    }
}
コード例 #6
0
//--------------------------------------------------------------------------------------
// CProjectModel implementation
//--------------------------------------------------------------------------------------
CProjectModel::CProjectModel()
{
   m_pProject = NULL;

   m_pAttributeModel    = new CAttributeModel();
   m_pBinaryFileModel   = new CBinaryFileModel();
   m_pCartridgeModel    = new CCartridgeModel();
   m_pFilterModel       = new CFilterModel(this);
   m_pGraphicsBankModel = new CGraphicsBankModel();
   m_pSourceFileModel   = new CSourceFileModel();
   m_pTileStampModel    = new CTileStampModel();
   m_pMusicModel        = new CMusicModel();

   // Reroute signals from submodels.
   QObject::connect(m_pAttributeModel,    SIGNAL(paletteAdded(QUuid)),        this, SLOT(onItemAdded(QUuid)));
   QObject::connect(m_pAttributeModel,    SIGNAL(paletteDeleted(QUuid)),      this, SLOT(onItemRemoved(QUuid)));
   QObject::connect(m_pBinaryFileModel,   SIGNAL(binaryFileAdded(QUuid)),     this, SLOT(onItemAdded(QUuid)));
   QObject::connect(m_pBinaryFileModel,   SIGNAL(binaryFileRemoved(QUuid)),   this, SLOT(onItemRemoved(QUuid)));
   QObject::connect(m_pGraphicsBankModel, SIGNAL(graphicsBankAdded(QUuid)),   this, SLOT(onItemAdded(QUuid)));
   QObject::connect(m_pGraphicsBankModel, SIGNAL(graphicsBankDeleted(QUuid)), this, SLOT(onItemRemoved(QUuid)));
   QObject::connect(m_pSourceFileModel,   SIGNAL(sourceFileAdded(QUuid)),     this, SLOT(onItemAdded(QUuid)));
   QObject::connect(m_pSourceFileModel,   SIGNAL(sourceFileRemoved(QUuid)),   this, SLOT(onItemRemoved(QUuid)));
   QObject::connect(m_pTileStampModel,    SIGNAL(tileStampAdded(QUuid)),      this, SLOT(onItemAdded(QUuid)));
   QObject::connect(m_pTileStampModel,    SIGNAL(tileStampRemoved(QUuid)),    this, SLOT(onItemRemoved(QUuid)));
   QObject::connect(m_pMusicModel,        SIGNAL(musicFileAdded(QUuid)),      this, SLOT(onItemAdded(QUuid)));
   QObject::connect(m_pMusicModel,        SIGNAL(musicFileDeleted(QUuid)),    this, SLOT(onItemRemoved(QUuid)));
}