summaryrefslogtreecommitdiff
path: root/noncore/net/opietooth/manager/popuphelper.cpp
blob: bd2071a1fc355530722b2ab27eb61f93d00524f0 (plain)
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

#include "stdpopups.h"
#include "popuphelper.h"

using namespace OpieTooth;

PopupHelper::PopupHelper() {
    init();
}

PopupHelper::~PopupHelper() {
}

void PopupHelper::insert( int id, popupFactory fact ) {
    m_map.insert(id, fact );
}

QPopupMenu* PopupHelper::find( int id, const Services& ser, BTDeviceItem* item ) {
    //owarn << "find" << oendl; 
    FactoryMap::Iterator it = m_map.find(id );
    if ( it != m_map.end() ) {
        //owarn << "found" << oendl; 
        popupFactory fact = it.data();
        return (*fact)(ser, item);
    }
    return 0l;
}

void PopupHelper::init() {
    insert( 4355, newRfcComPopup );
    insert( 4354, newDunPopup );
    insert( 4353, newRfcComPopup );
    insert( 4357, newObexPushPopup );
    insert( 4358, newObexFtpPopup );
    insert( 4374, newPanPopup );
}