small cleanups
parent
25ee420e88
commit
e3d9df5813
|
@ -46,6 +46,9 @@ impl DirEntry {
|
|||
|
||||
impl Item for DirEntry {
|
||||
fn data<'a>(&self, role: c_int) -> Variant<'a> {
|
||||
if role != 0 {
|
||||
return Variant::None
|
||||
}
|
||||
let str = self.name.to_string_lossy().to_string();
|
||||
return Variant::from(str);
|
||||
}
|
||||
|
@ -147,8 +150,8 @@ impl<T: Item> RItemModelTrait<T> for RGeneralItemModel<T> {
|
|||
entries: vec![none, root]
|
||||
}
|
||||
}
|
||||
fn column_count(&mut self, parent: QModelIndex) -> c_int {
|
||||
1
|
||||
fn column_count(&mut self, _: QModelIndex) -> c_int {
|
||||
2
|
||||
}
|
||||
fn row_count(&mut self, parent: QModelIndex) -> c_int {
|
||||
let i = self.get(&parent);
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
use std::slice;
|
||||
use libc::{c_int, uint8_t, uint16_t, size_t, c_void};
|
||||
use libc::{c_int, uint16_t, size_t, c_void};
|
||||
use types::*;
|
||||
|
||||
use implementation::*;
|
||||
|
|
|
@ -144,12 +144,6 @@ void set_variant(void* v, qvariant_t* val) {
|
|||
|
||||
QVariant RItemModel::data(const QModelIndex &index, int role) const
|
||||
{
|
||||
if (!index.isValid()) {
|
||||
return QVariant();
|
||||
}
|
||||
if (role != Qt::DisplayRole) {
|
||||
return QVariant();
|
||||
}
|
||||
const qmodelindex_t i = {
|
||||
.row = index.row(),
|
||||
.column = index.column(),
|
||||
|
|
Loading…
Reference in New Issue