Small cleanups to dragging partition entries code.
This commit is contained in:
@@ -288,7 +288,7 @@ PartitionListRow::DevicePath()
|
|||||||
= dynamic_cast<BBitmapStringField*>(GetField(kDeviceColumn));
|
= dynamic_cast<BBitmapStringField*>(GetField(kDeviceColumn));
|
||||||
|
|
||||||
if (stringField == NULL)
|
if (stringField == NULL)
|
||||||
return "";
|
return NULL;
|
||||||
|
|
||||||
return stringField->String();
|
return stringField->String();
|
||||||
}
|
}
|
||||||
@@ -330,22 +330,22 @@ PartitionListView::InitiateDrag(BPoint rowPoint, bool wasSelected)
|
|||||||
{
|
{
|
||||||
PartitionListRow* draggedRow
|
PartitionListRow* draggedRow
|
||||||
= dynamic_cast<PartitionListRow*>(RowAt(rowPoint));
|
= dynamic_cast<PartitionListRow*>(RowAt(rowPoint));
|
||||||
if (draggedRow != NULL) {
|
if (draggedRow == NULL)
|
||||||
BRect draggedRowRect;
|
return false;
|
||||||
GetRowRect(draggedRow, &draggedRowRect);
|
|
||||||
|
|
||||||
const char* draggedPath = draggedRow->DevicePath();
|
const char* draggedPath = draggedRow->DevicePath();
|
||||||
if (draggedPath != NULL) {
|
if (draggedPath == NULL)
|
||||||
BMessage *drag = new BMessage(B_MIME_DATA);
|
return false;
|
||||||
drag->AddData("text/plain", B_MIME_TYPE, draggedPath, strlen(draggedPath));
|
|
||||||
|
|
||||||
DragMessage(drag, draggedRowRect, NULL);
|
BRect draggedRowRect;
|
||||||
|
GetRowRect(draggedRow, &draggedRowRect);
|
||||||
|
|
||||||
return true;
|
BMessage dragMessage(B_MIME_DATA);
|
||||||
}
|
dragMessage.AddData("text/plain", B_MIME_TYPE, draggedPath,
|
||||||
}
|
strlen(draggedPath));
|
||||||
|
|
||||||
return false;
|
DragMessage(&dragMessage, draggedRowRect, NULL);
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -79,6 +79,7 @@ public:
|
|||||||
{ return fSize; }
|
{ return fSize; }
|
||||||
|
|
||||||
const char* DevicePath();
|
const char* DevicePath();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
partition_id fPartitionID;
|
partition_id fPartitionID;
|
||||||
partition_id fParentID;
|
partition_id fParentID;
|
||||||
|
|||||||
Reference in New Issue
Block a user