mirror of
https://bitbucket.org/smil3y/kdelibs.git
synced 2025-02-24 02:42:48 +00:00
generic: remove bogus KMultiTabBarInternal and KACLListView reimplementations
there are no virtual QFrame::contentsMousePressEvent() and QTreeWidget::contentsMousePressEvent() methods Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
c311f7032f
commit
59b6598599
5 changed files with 48 additions and 92 deletions
|
@ -86,11 +86,6 @@ void KMultiTabBarInternal::setStyle(enum KMultiTabBar::KMultiTabBarStyle style)
|
||||||
updateGeometry();
|
updateGeometry();
|
||||||
}
|
}
|
||||||
|
|
||||||
void KMultiTabBarInternal::contentsMousePressEvent(QMouseEvent *ev)
|
|
||||||
{
|
|
||||||
ev->ignore();
|
|
||||||
}
|
|
||||||
|
|
||||||
void KMultiTabBarInternal::mousePressEvent(QMouseEvent *ev)
|
void KMultiTabBarInternal::mousePressEvent(QMouseEvent *ev)
|
||||||
{
|
{
|
||||||
ev->ignore();
|
ev->ignore();
|
||||||
|
|
|
@ -33,28 +33,29 @@ class KMultiTabBarInternal: public QFrame
|
||||||
public:
|
public:
|
||||||
KMultiTabBarInternal(QWidget *parent, KMultiTabBar::KMultiTabBarPosition pos);
|
KMultiTabBarInternal(QWidget *parent, KMultiTabBar::KMultiTabBarPosition pos);
|
||||||
virtual ~KMultiTabBarInternal();
|
virtual ~KMultiTabBarInternal();
|
||||||
int appendTab(const QPixmap &,int=-1,const QString& =QString());
|
|
||||||
|
int appendTab(const QPixmap &, int = -1,const QString & = QString());
|
||||||
KMultiTabBarTab *tab(int) const;
|
KMultiTabBarTab *tab(int) const;
|
||||||
void removeTab(int);
|
void removeTab(int);
|
||||||
void setPosition(enum KMultiTabBar::KMultiTabBarPosition pos);
|
void setPosition(enum KMultiTabBar::KMultiTabBarPosition pos);
|
||||||
void setStyle(enum KMultiTabBar::KMultiTabBarStyle style);
|
void setStyle(enum KMultiTabBar::KMultiTabBarStyle style);
|
||||||
void showActiveTabTexts(bool show);
|
void showActiveTabTexts(bool show);
|
||||||
QList<KMultiTabBarTab*>* tabs(){return &m_tabs;}
|
QList<KMultiTabBarTab*>* tabs() { return &m_tabs; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
friend class KMultiTabBar;
|
friend class KMultiTabBar;
|
||||||
QBoxLayout *mainLayout;
|
QBoxLayout *mainLayout;
|
||||||
QList<KMultiTabBarTab*> m_tabs;
|
QList<KMultiTabBarTab*> m_tabs;
|
||||||
enum KMultiTabBar::KMultiTabBarPosition m_position;
|
enum KMultiTabBar::KMultiTabBarPosition m_position;
|
||||||
enum KMultiTabBar::KMultiTabBarStyle m_style;
|
enum KMultiTabBar::KMultiTabBarStyle m_style;
|
||||||
protected:
|
|
||||||
|
|
||||||
|
protected:
|
||||||
/**
|
/**
|
||||||
* [contentsM|m]ousePressEvent are reimplemented from QScrollView
|
* mousePressEvent is reimplemented from QFrame
|
||||||
* in order to ignore all mouseEvents on the viewport, so that the
|
* in order to ignore all mouseEvents on the viewport, so that the
|
||||||
* parent can handle them.
|
* parent can handle them.
|
||||||
*/
|
*/
|
||||||
virtual void contentsMousePressEvent(QMouseEvent *);
|
void mousePressEvent(QMouseEvent *ev) final;
|
||||||
virtual void mousePressEvent(QMouseEvent *);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -772,45 +772,6 @@ KACL KACLListView::getDefaultACL()
|
||||||
return itemsToACL( true );
|
return itemsToACL( true );
|
||||||
}
|
}
|
||||||
|
|
||||||
void KACLListView::contentsMousePressEvent( QMouseEvent * /*e*/ )
|
|
||||||
{
|
|
||||||
/*
|
|
||||||
QTreeWidgetItem *clickedItem = itemAt( e->pos() );
|
|
||||||
if ( !clickedItem ) return;
|
|
||||||
// if the click is on an as yet unselected item, select it first
|
|
||||||
if ( !clickedItem->isSelected() )
|
|
||||||
QAbstractItemView::contentsMousePressEvent( e );
|
|
||||||
|
|
||||||
if ( !currentItem() ) return;
|
|
||||||
int column = header()->sectionAt( e->x() );
|
|
||||||
acl_perm_t perm;
|
|
||||||
switch ( column )
|
|
||||||
{
|
|
||||||
case 2:
|
|
||||||
perm = ACL_READ;
|
|
||||||
break;
|
|
||||||
case 3:
|
|
||||||
perm = ACL_WRITE;
|
|
||||||
break;
|
|
||||||
case 4:
|
|
||||||
perm = ACL_EXECUTE;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
return QTreeWidget::contentsMousePressEvent( e );
|
|
||||||
}
|
|
||||||
KACLListViewItem* referenceItem = static_cast<KACLListViewItem*>( clickedItem );
|
|
||||||
unsigned short referenceHadItSet = referenceItem->value & perm;
|
|
||||||
QTreeWidgetItemIterator it( this );
|
|
||||||
while ( KACLListViewItem* item = static_cast<KACLListViewItem*>( *it ) ) {
|
|
||||||
++it;
|
|
||||||
if ( !item->isSelected() ) continue;
|
|
||||||
// toggle those with the same value as the clicked item, leave the others
|
|
||||||
if ( referenceHadItSet == ( item->value & perm ) )
|
|
||||||
item->togglePerm( perm );
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
}
|
|
||||||
|
|
||||||
void KACLListView::slotItemClicked( QTreeWidgetItem* pItem, int col )
|
void KACLListView::slotItemClicked( QTreeWidgetItem* pItem, int col )
|
||||||
{
|
{
|
||||||
if ( !pItem ) return;
|
if ( !pItem ) return;
|
||||||
|
|
|
@ -46,11 +46,10 @@ class KACLListView;
|
||||||
*/
|
*/
|
||||||
class KACLListView : public QTreeWidget
|
class KACLListView : public QTreeWidget
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
friend class KACLListViewItem;
|
friend class KACLListViewItem;
|
||||||
public:
|
public:
|
||||||
enum Types
|
enum Types {
|
||||||
{
|
|
||||||
OWNER_IDX = 0,
|
OWNER_IDX = 0,
|
||||||
GROUP_IDX,
|
GROUP_IDX,
|
||||||
OTHERS_IDX,
|
OTHERS_IDX,
|
||||||
|
@ -59,15 +58,18 @@ public:
|
||||||
NAMED_GROUP_IDX,
|
NAMED_GROUP_IDX,
|
||||||
LAST_IDX
|
LAST_IDX
|
||||||
};
|
};
|
||||||
enum EntryType { User = 1,
|
|
||||||
Group = 2,
|
|
||||||
Others = 4,
|
|
||||||
Mask = 8,
|
|
||||||
NamedUser = 16,
|
|
||||||
NamedGroup = 32,
|
|
||||||
AllTypes = 63 };
|
|
||||||
|
|
||||||
KACLListView( QWidget* parent = 0 );
|
enum EntryType {
|
||||||
|
User = 1,
|
||||||
|
Group = 2,
|
||||||
|
Others = 4,
|
||||||
|
Mask = 8,
|
||||||
|
NamedUser = 16,
|
||||||
|
NamedGroup = 32,
|
||||||
|
AllTypes = 63
|
||||||
|
};
|
||||||
|
|
||||||
|
KACLListView(QWidget *parent = nullptr);
|
||||||
~KACLListView();
|
~KACLListView();
|
||||||
|
|
||||||
bool hasMaskEntry() const { return m_hasMask; }
|
bool hasMaskEntry() const { return m_hasMask; }
|
||||||
|
@ -75,21 +77,21 @@ public:
|
||||||
bool allowDefaults() const { return m_allowDefaults; }
|
bool allowDefaults() const { return m_allowDefaults; }
|
||||||
void setAllowDefaults( bool v ) { m_allowDefaults = v; }
|
void setAllowDefaults( bool v ) { m_allowDefaults = v; }
|
||||||
unsigned short maskPermissions() const;
|
unsigned short maskPermissions() const;
|
||||||
void setMaskPermissions( unsigned short maskPerms );
|
void setMaskPermissions(unsigned short maskPerms);
|
||||||
acl_perm_t maskPartialPermissions() const;
|
acl_perm_t maskPartialPermissions() const;
|
||||||
void setMaskPartialPermissions( acl_perm_t maskPerms );
|
void setMaskPartialPermissions(acl_perm_t maskPerms);
|
||||||
|
|
||||||
bool maskCanBeDeleted() const;
|
bool maskCanBeDeleted() const;
|
||||||
bool defaultMaskCanBeDeleted() const;
|
bool defaultMaskCanBeDeleted() const;
|
||||||
|
|
||||||
const KACLListViewItem* findDefaultItemByType( EntryType type ) const;
|
const KACLListViewItem* findDefaultItemByType(EntryType type) const;
|
||||||
const KACLListViewItem* findItemByType( EntryType type,
|
const KACLListViewItem* findItemByType(EntryType type,
|
||||||
bool defaults = false ) const;
|
bool defaults = false) const;
|
||||||
unsigned short calculateMaskValue( bool defaults ) const;
|
unsigned short calculateMaskValue(bool defaults) const;
|
||||||
void calculateEffectiveRights();
|
void calculateEffectiveRights();
|
||||||
|
|
||||||
QStringList allowedUsers( bool defaults, KACLListViewItem *allowedItem = 0 );
|
QStringList allowedUsers(bool defaults, KACLListViewItem *allowedItem = nullptr);
|
||||||
QStringList allowedGroups( bool defaults, KACLListViewItem *allowedItem = 0 );
|
QStringList allowedGroups(bool defaults, KACLListViewItem *allowedItem = nullptr);
|
||||||
|
|
||||||
KACL getACL();
|
KACL getACL();
|
||||||
|
|
||||||
|
@ -102,17 +104,15 @@ public Q_SLOTS:
|
||||||
void slotAddEntry();
|
void slotAddEntry();
|
||||||
void slotEditEntry();
|
void slotEditEntry();
|
||||||
void slotRemoveEntry();
|
void slotRemoveEntry();
|
||||||
void setACL( const KACL &anACL );
|
void setACL(const KACL &anACL);
|
||||||
void setDefaultACL( const KACL &anACL );
|
void setDefaultACL(const KACL &anACL);
|
||||||
|
|
||||||
protected Q_SLOTS:
|
protected Q_SLOTS:
|
||||||
void slotItemClicked( QTreeWidgetItem* pItem, int col );
|
void slotItemClicked(QTreeWidgetItem* pItem, int col);
|
||||||
protected:
|
|
||||||
void contentsMousePressEvent( QMouseEvent * e );
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void fillItemsFromACL( const KACL &pACL, bool defaults = false );
|
void fillItemsFromACL(const KACL &pACL, bool defaults = false);
|
||||||
KACL itemsToACL( bool defaults ) const;
|
KACL itemsToACL(bool defaults) const;
|
||||||
|
|
||||||
KACL m_ACL;
|
KACL m_ACL;
|
||||||
KACL m_defaultACL;
|
KACL m_defaultACL;
|
||||||
|
@ -129,18 +129,18 @@ class EditACLEntryDialog : public KDialog
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
EditACLEntryDialog( KACLListView *listView, KACLListViewItem *item,
|
EditACLEntryDialog(KACLListView *listView, KACLListViewItem *item,
|
||||||
const QStringList &users,
|
const QStringList &users,
|
||||||
const QStringList &groups,
|
const QStringList &groups,
|
||||||
const QStringList &defaultUsers,
|
const QStringList &defaultUsers,
|
||||||
const QStringList &defaultGroups,
|
const QStringList &defaultGroups,
|
||||||
int allowedTypes = KACLListView::AllTypes,
|
int allowedTypes = KACLListView::AllTypes,
|
||||||
int allowedDefaultTypes = KACLListView::AllTypes,
|
int allowedDefaultTypes = KACLListView::AllTypes,
|
||||||
bool allowDefault = false );
|
bool allowDefault = false);
|
||||||
KACLListViewItem* item() const { return m_item; }
|
KACLListViewItem* item() const { return m_item; }
|
||||||
public Q_SLOTS:
|
public Q_SLOTS:
|
||||||
void slotOk();
|
void slotOk();
|
||||||
void slotSelectionChanged( QAbstractButton* );
|
void slotSelectionChanged(QAbstractButton *);
|
||||||
private Q_SLOTS:
|
private Q_SLOTS:
|
||||||
void slotUpdateAllowedUsersAndGroups();
|
void slotUpdateAllowedUsersAndGroups();
|
||||||
void slotUpdateAllowedTypes();
|
void slotUpdateAllowedTypes();
|
||||||
|
@ -165,20 +165,20 @@ private:
|
||||||
class KACLListViewItem : public QTreeWidgetItem
|
class KACLListViewItem : public QTreeWidgetItem
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
KACLListViewItem( QTreeWidget* parent, KACLListView::EntryType type,
|
KACLListViewItem(QTreeWidget *parent, KACLListView::EntryType type,
|
||||||
unsigned short value,
|
unsigned short value,
|
||||||
bool defaultEntry,
|
bool defaultEntry,
|
||||||
const QString& qualifier = QString() );
|
const QString &qualifier = QString());
|
||||||
virtual ~KACLListViewItem();
|
virtual ~KACLListViewItem();
|
||||||
QString key() const;
|
QString key() const;
|
||||||
bool operator< ( const QTreeWidgetItem & other ) const;
|
bool operator< (const QTreeWidgetItem &other) const;
|
||||||
|
|
||||||
void calcEffectiveRights();
|
void calcEffectiveRights();
|
||||||
|
|
||||||
bool isDeletable() const;
|
bool isDeletable() const;
|
||||||
bool isAllowedToChangeType() const;
|
bool isAllowedToChangeType() const;
|
||||||
|
|
||||||
void togglePerm( acl_perm_t perm );
|
void togglePerm(acl_perm_t perm);
|
||||||
|
|
||||||
void updatePermPixmaps();
|
void updatePermPixmaps();
|
||||||
void repaint();
|
void repaint();
|
||||||
|
|
|
@ -80,7 +80,6 @@ QString KDiskFreeSpaceInfo::mountPoint() const
|
||||||
return d->mountPoint;
|
return d->mountPoint;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
KIO::filesize_t KDiskFreeSpaceInfo::size() const
|
KIO::filesize_t KDiskFreeSpaceInfo::size() const
|
||||||
{
|
{
|
||||||
return d->size;
|
return d->size;
|
||||||
|
|
Loading…
Add table
Reference in a new issue